matlab问题:用surf和surfc绘图是不是必须用meshgrid定义变量例如我这有写的话:x1=2000:5:3600;x2=2000:5:3600;f=70*x1+120*x2;surfc(x1,x2,f);提示错误:Error using ==> surfc at 42The surface Z must contain more than one row or
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/28 10:50:50
![matlab问题:用surf和surfc绘图是不是必须用meshgrid定义变量例如我这有写的话:x1=2000:5:3600;x2=2000:5:3600;f=70*x1+120*x2;surfc(x1,x2,f);提示错误:Error using ==> surfc at 42The surface Z must contain more than one row or](/uploads/image/z/637038-54-8.jpg?t=matlab%E9%97%AE%E9%A2%98%EF%BC%9A%E7%94%A8surf%E5%92%8Csurfc%E7%BB%98%E5%9B%BE%E6%98%AF%E4%B8%8D%E6%98%AF%E5%BF%85%E9%A1%BB%E7%94%A8meshgrid%E5%AE%9A%E4%B9%89%E5%8F%98%E9%87%8F%E4%BE%8B%E5%A6%82%E6%88%91%E8%BF%99%E6%9C%89%E5%86%99%E7%9A%84%E8%AF%9D%EF%BC%9Ax1%3D2000%3A5%3A3600%3Bx2%3D2000%3A5%3A3600%3Bf%3D70%2Ax1%2B120%2Ax2%3Bsurfc%28x1%2Cx2%2Cf%29%3B%E6%8F%90%E7%A4%BA%E9%94%99%E8%AF%AF%EF%BC%9AError+using+%3D%3D%3E+surfc+at+42The+surface+Z+must+contain+more+than+one+row+or)
matlab问题:用surf和surfc绘图是不是必须用meshgrid定义变量例如我这有写的话:x1=2000:5:3600;x2=2000:5:3600;f=70*x1+120*x2;surfc(x1,x2,f);提示错误:Error using ==> surfc at 42The surface Z must contain more than one row or
matlab问题:用surf和surfc绘图是不是必须用meshgrid定义变量
例如我这有写的话:
x1=2000:5:3600;
x2=2000:5:3600;
f=70*x1+120*x2;
surfc(x1,x2,f);
提示错误:Error using ==> surfc at 42
The surface Z must contain more than one row or column.
但是我用meshgrid的话没有问题,程序如下:
[x1,x2]=meshgrid(2000:5:3600);
f=70*x1+120*x2;
surfc(x1,x2,f);
请问这是什么原因?当使用surf和surfc时是不是必须用meshgrid?不用的话怎么定义变量?
matlab问题:用surf和surfc绘图是不是必须用meshgrid定义变量例如我这有写的话:x1=2000:5:3600;x2=2000:5:3600;f=70*x1+120*x2;surfc(x1,x2,f);提示错误:Error using ==> surfc at 42The surface Z must contain more than one row or
surf和surfc是网格绘图,所以用的数据必须是meshgrid生成的数据,或者是二维矩阵