求助用matlab画三维图
y=[0.03,0.04,0.05,0.06,0.07]; y取这5个数
z=[9.5869,9.8443,9.6682,9.4436,9.6937;
9.6794,9.4763,9.2275,9.2439,9.5396;
9.6342,9.6472,9.7845,9.4961,9.2596;
9.5531,9.5781,9.4625,9.6549,9.4775;
9.0017,9.6543,9.5531,9.3018,9.6387]; 当x=0.7,y=0.03时候z=9.5869;x=0.7,y=0.04时z=9.8443一次类推,这样画一个三维图。谢谢啦 展开
> x=[0.7,0.75,0.8,0.85,0.9];
y=[0.03,0.04,0.05,0.06,0.07];
z=[9.5869,9.8443,9.6682,9.4436,9.6937;
9.6794,9.4763,9.2275,9.2439,9.5396;
9.6342,9.6472,9.7845,9.4961,9.2596;
9.5531,9.5781,9.4625,9.6549,9.4775;
9.0017,9.6543,9.5531,9.3018,9.6387];
>> [X,Y]=meshgrid(x,y)
X =
0.7000 0.7500 0.8000 0.8500 0.9000
0.7000 0.7500 0.8000 0.8500 0.9000
0.7000 0.7500 0.8000 0.8500 0.9000
0.7000 0.7500 0.8000 0.8500 0.9000
0.7000 0.7500 0.8000 0.8500 0.9000
Y =
0.0300 0.0300 0.0300 0.0300 0.0300
0.0400 0.0400 0.0400 0.0400 0.0400
0.0500 0.0500 0.0500 0.0500 0.0500
0.0600 0.0600 0.0600 0.0600 0.0600
0.0700 0.0700 0.0700 0.0700 0.0700
surf(X,Y,z) %做三维曲面图。
就是画出的图不带颜色可以吗?(x和y要写成矩阵,而且要对应z,这个已经ok啦!)谢谢啊
先用[X,Y]=meshgrid(x,y)构造平面网格矩阵
再用mesh(X,Y,z) %做三维网格图就可以了。