想请教一个关于matlab画三维曲面图的问题使用matlab画曲面图的问题:我这里有三组数据:x=[3,5.05,6.7,8.8,10.1,11.8,14.33,16.64,17.7,20,21.5,24.8,26.8,28.3,30.8,32.7,35.1,36.8,39.7,41.3,43.4,45,49.1,50.9,54.1,56.5,58.8,60
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/08 15:25:11
想请教一个关于matlab画三维曲面图的问题使用matlab画曲面图的问题:我这里有三组数据:x=[3,5.05,6.7,8.8,10.1,11.8,14.33,16.64,17.7,20,21.5,24.8,26.8,28.3,30.8,32.7,35.1,36.8,39.7,41.3,43.4,45,49.1,50.9,54.1,56.5,58.8,60
想请教一个关于matlab画三维曲面图的问题
使用matlab画曲面图的问题:我这里有三组数据:
x=[3,5.05,6.7,8.8,10.1,11.8,14.33,16.64,17.7,20,21.5,24.8,26.8,28.3,30.8,32.7,35.1,36.8,39.7,41.3,43.4,45,49.1,50.9,54.1,56.5,58.8,60.9,64.1,64.9,67.5,70,72.5,74.5,76.8,80,81.8,84.9,87.1,90,92];
y=[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];
z=[20.81,20.48,20.53,20.3,19.8,19.2,18.95,18.82,18.68,17.99,15.75,14.81,12.5,11.88,10.57,10.22,9.88,9.43,8.88,8.3,7.77,7.48,7.29,7.02,6.85,6.77,6.54,6.01,5.88,5.68,5.55,5.41,5.38,5.21,5.12,4.8,4.64,4.52,4.44,4.31,4.28];
想画三维曲面图.我是matlab初学者,尝试了很多次.
想请教一个关于matlab画三维曲面图的问题使用matlab画曲面图的问题:我这里有三组数据:x=[3,5.05,6.7,8.8,10.1,11.8,14.33,16.64,17.7,20,21.5,24.8,26.8,28.3,30.8,32.7,35.1,36.8,39.7,41.3,43.4,45,49.1,50.9,54.1,56.5,58.8,60
三维曲面实际是张网格,如下:
也就是说,如果你X、Y是向量,则Z必须是矩阵,Z中每个元素就是网格的交点.如果X向量长度为a,Y向量长度为b,则Z应该是a*b矩阵,这样才能对应起来.
matlab中mesh或者surf函数即是如此,最常用的一个形式,mesh(X, Y, Z),其中X为m维向量,Y为n维向量,则Z为n*m矩阵(注意与上段所说不同,类似转置了).网格交点坐标为[X(j),Y(i),Z(i,j)].
你给的数据,X、Y、Z是长度相等的向量,只能画曲线.如下 :
代码为:
grid on;
label('x');
label('y');
label('z');