matlab使用插值进行着色处理Z must be a matrix,not a scalar or vector
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/08/12 03:02:04
matlab使用插值进行着色处理Z must be a matrix,not a scalar or vector
![](http://img.wesiedu.com/upload/b/f3/bf311ff9b374233070f73ea4d3beee8e.jpg)
z应该怎么改?
>> [x,y]=meshgrid(-5:0.1:5);
>> z=5;
>> surf(x,y,z);shading interp;
Error using surf (line 75)
Z must be a matrix,not a scalar or vector
![](http://img.wesiedu.com/upload/b/f3/bf311ff9b374233070f73ea4d3beee8e.jpg)
z应该怎么改?
>> [x,y]=meshgrid(-5:0.1:5);
>> z=5;
>> surf(x,y,z);shading interp;
Error using surf (line 75)
Z must be a matrix,not a scalar or vector
![matlab使用插值进行着色处理Z must be a matrix,not a scalar or vector](/uploads/image/z/8521935-15-5.jpg?t=matlab%E4%BD%BF%E7%94%A8%E6%8F%92%E5%80%BC%E8%BF%9B%E8%A1%8C%E7%9D%80%E8%89%B2%E5%A4%84%E7%90%86Z+must+be+a+matrix%2Cnot+a+scalar+or+vector)
z应该这样写:z=5*ones(size(x));
surf和mesh中x,y,z必须是同样维度的矩阵.
完整代码如下:
clear
clc
[x,y]=meshgrid(-5:0.1:5);
z=5*ones(size(x));
surf(x,y,z);
shading interp;
运行出来的结果如下:
![](http://img.wesiedu.com/upload/2/e8/2e8c2e21be10d92b519b9a1c610965c1.jpg)
surf和mesh中x,y,z必须是同样维度的矩阵.
完整代码如下:
clear
clc
[x,y]=meshgrid(-5:0.1:5);
z=5*ones(size(x));
surf(x,y,z);
shading interp;
运行出来的结果如下:
![](http://img.wesiedu.com/upload/2/e8/2e8c2e21be10d92b519b9a1c610965c1.jpg)
matlab使用插值进行着色处理Z must be a matrix,not a scalar or vector
matlab报错Z must be a matrix, not a scalar or vector,哪里出错了?
matlab程序运行错误 “Z must be a matrix,not a scalar or vector.”
matlab 为什么会出现Z must be a matrix,not a scalar or vector
Error using ==> surf at 78 Z must be a matrix,not a scalar o
matlab 急救 Inputs must be a scalar and a square matrix.
Matlab求助:Inputs must be a scalar and a square matrix
Is pressure a vector or scalar quantity?
matlab Error using ==> mpower Inputs must be a scalar and a
matlab错误 Error using ==> mpower Inputs must be a scalar and
matlab报错?Error using ==> mpower Inputs must be a scalar and
matlab计算时出现“ Error using ==> mpower Inputs must be a scalar