2017-05-09 51 views
0

我试图复制文件中的结果。我用来产生该图的我的代码段如下所示:在MATLAB中创建等值线图

xd = linspace(-2.5,2.5,199); % Build the axes in physical dimensions 
    yd = linspace(0,4.92,400); 
    [xdg, ydg] = meshgrid(yd, xd); 
    mesh(xd,yd,sardb) 
    colorbar('southoutside') 
    colormap(jet) 
    xlabel('(cm)'); % x-axis label 
    set(gca,'fontsize',12) 
    set (gca,'FontName','times new roman') 
    view([90 90]) 
    caxis([-15 0]) 

在本质上我显示该结果是一个网格的顶视图。但我需要在纸上复制轮廓线。我已经尝试了所有matlab的轮廓函数,但无法得到作者在纸上得到的轮廓线。

我的结果:

My result

纸业的结果:

Paper's result

回答

0

你用MATLAB命令contour?例如

x = linspace(-2*pi,2*pi); 
y = linspace(0,4*pi); 
[X,Y] = meshgrid(x,y); 
Z = sin(X)+cos(Y); 
figure 
contour(X,Y,Z) 
+0

我有但它不给我正确的情节 – Moe