MATLAB中拟合函数生成的变网格曲面

MATLAB中拟合函数生成的变网格曲面,matlab,plot,matlab-figure,surface,mplot3d,Matlab,Plot,Matlab Figure,Surface,Mplot3d,我通过拟合函数生成了以下曲线图: [xrData, yrData, zrData] = prepareSurfaceData( Vr, Vi, Cr ); %this is my data used ftr = 'lowess'; surffitr = fit( [xrData, yrData], zrData, ftr, 'Normalize', 'on' ); %Then I can plot the surface: plot(surffitr,[xrData, yrData],

我通过拟合函数生成了以下曲线图:

[xrData, yrData, zrData] = prepareSurfaceData( Vr, Vi, Cr );      %this is my data used
ftr = 'lowess';
surffitr = fit( [xrData, yrData], zrData, ftr, 'Normalize', 'on' );
%Then I can plot the surface:
plot(surffitr,[xrData, yrData], zrData)
grid on
set(gca,'FontSize',16)
set(gcf,'color','w')
set(gcf,'units','normalized','outerposition',[0 0 1 1]) %maximize plot window to be saved
xlabel('Real Part of $\bar{V}^{+}_{f}, Re(\bar{V}^{+}_{f}) (V)$ ','Interpreter','latex')
ylabel('Imaginary Part of $\bar{V}^{+}_{f}, Im(\bar{V}^{+}_{f}) (V)$ ','Interpreter','latex')
zlabel('Real Part of $I^{+}_{vd} (A)$','Interpreter','latex')
这将生成以下内容:

关键是,我想改变我的曲面网格,例如移除它,或者使用不同的图案(增加每个单元之间的空间)

我没有直接使用surf()函数,所以我对如何使用它有点困惑。 谁能帮帮我吗


谢谢大家!

一旦对曲面进行了拟合,就可以将其应用到所需的任何网格

因此,例如,如果要增加/减少网格大小,请生成一个新网格

[xNew, yNew] = meshgrid(minX:gridSizeX:maxX, minY:gridSizeY:maxY);
确定x和y变量的最小、最大和网格大小值,然后对其应用拟合

zNew = surffitr(xNew, ynew);
之后,您可以按任意方式绘制它(使用surf、CONTOURE等)