matlab中怎么对下面的程序进行二维插值并画出三维视图呢?[x,y]=meshgrid(-2:1:2);t=2;Z=[(sin(t))^3 t^2 sin(t) cos(t) (sin(t))^2;t^2 sin(t) (cos(t))^4 cos(t) (sin(t))^2;t sin(t) cos(t) t^2 (sin(t))^2;sin(t) (cos(t))^3 t^2 (sin(t))^2
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 07:28:49
matlab中怎么对下面的程序进行二维插值并画出三维视图呢?[x,y]=meshgrid(-2:1:2);t=2;Z=[(sin(t))^3 t^2 sin(t) cos(t) (sin(t))^2;t^2 sin(t) (cos(t))^4 cos(t) (sin(t))^2;t sin(t) cos(t) t^2 (sin(t))^2;sin(t) (cos(t))^3 t^2 (sin(t))^2
matlab中怎么对下面的程序进行二维插值并画出三维视图呢?
[x,y]=meshgrid(-2:1:2);
t=2;
Z=[(sin(t))^3 t^2 sin(t) cos(t) (sin(t))^2;t^2 sin(t) (cos(t))^4 cos(t) (sin(t))^2;t sin(t) cos(t) t^2 (sin(t))^2;sin(t) (cos(t))^3 t^2 (sin(t))^2 cos(t);(cos(t))^3 sin(t) t^2 (sin(t))^2 cos(t)];
surf(x,y,Z);
matlab中怎么对下面的程序进行二维插值并画出三维视图呢?[x,y]=meshgrid(-2:1:2);t=2;Z=[(sin(t))^3 t^2 sin(t) cos(t) (sin(t))^2;t^2 sin(t) (cos(t))^4 cos(t) (sin(t))^2;t sin(t) cos(t) t^2 (sin(t))^2;sin(t) (cos(t))^3 t^2 (sin(t))^2
接着你的代码往下写:
[x1,y1]=meshgrid(-2:0.1:2);
z1 = interp2(x,y,Z,x1,y1);
figure;
surf(x1,y1,z1);