MATLAB中出现Too many output arguments在M-File中输入x=-3*pi:3*pi;y=x;[X,Y]=meshgrid(x,y);R=sqrt(x.^2+y.^2)+eps;Z=sin(R)./R;[dzdx,dzdy]=gradient(Z);dzdr=sqrt(dzdx.^2+dzdy.^2);surf(X,Y,Z,abs(dzdr))corlormap(spring)alphamap('rampup')corlorbar保
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 19:56:14
MATLAB中出现Too many output arguments在M-File中输入x=-3*pi:3*pi;y=x;[X,Y]=meshgrid(x,y);R=sqrt(x.^2+y.^2)+eps;Z=sin(R)./R;[dzdx,dzdy]=gradient(Z);dzdr=sqrt(dzdx.^2+dzdy.^2);surf(X,Y,Z,abs(dzdr))corlormap(spring)alphamap('rampup')corlorbar保
MATLAB中出现Too many output arguments
在M-File中输入
x=-3*pi:3*pi;
y=x;
[X,Y]=meshgrid(x,y);
R=sqrt(x.^2+y.^2)+eps;
Z=sin(R)./R;
[dzdx,dzdy]=gradient(Z);
dzdr=sqrt(dzdx.^2+dzdy.^2);
surf(X,Y,Z,abs(dzdr))
corlormap(spring)
alphamap('rampup')
corlorbar
保存为interp3,运行interp3,出现
Error using ==> gradient
Too many output arguments.
Error in ==> interxp3 at 6
[dzdx,dzdy]=gradient(Z);
怎么解决
MATLAB中出现Too many output arguments在M-File中输入x=-3*pi:3*pi;y=x;[X,Y]=meshgrid(x,y);R=sqrt(x.^2+y.^2)+eps;Z=sin(R)./R;[dzdx,dzdy]=gradient(Z);dzdr=sqrt(dzdx.^2+dzdy.^2);surf(X,Y,Z,abs(dzdr))corlormap(spring)alphamap('rampup')corlorbar保
x=-3*pi:3*pi;
y=x;
[X,Y]=meshgrid(x,y);
R=sqrt(X.^2+Y.^2)+eps; % 这里应该是大写的X和Y,这样才能得到一个2维的Z矩阵
Z=sin(R)./R;
[dzdx,dzdy]=gradient(Z);
dzdr=sqrt(dzdx.^2+dzdy.^2);
% 这次应该不会错了.