I'm trying to create a surface plot for an equation,
the code returns the error ??? Error using ==> contourc Contour data must have 2 dimensions
Error in ==> contours at 57 CS=contourc(varargin{numarg_for_call});
Error in ==> contour3 at 87 [c,msg] = contours(args{1:nin});
Error in ==> surfc at 62 [cc,hh] = contour3(cax,x,y,z); %#ok
Error in ==> Untitled4 at 6 surfc(X,Y,Z,C);
Warning: size(CData) must equal size(ZData) or size(ZData)-1 for flat shading
my code is
x = -1:1:1; y = -1:1:1;z = -1:1:1;[X,Y,Z] = meshgrid(x,y,z);C = (1.10471.*((Z).^2) .* ((X).^2))+(0.0481.*(Y.*Z)*14.*X);surfc(X,Y,Z,C);axis([-1 1 -1 1 -1 1]);
Any help would be really appreciated!
Best Answer