|
hello
good day to you all
please could someone please guide me on how to solve this error. thanks so much for the time.
Below is the code. I really want to plot a function with 4 variables.
X = gallery('uniformdata',[5000 1],0)-1;
A = gallery('uniformdata',[5000 1],1)-1;
B = gallery('uniformdata',[5000 1],2)-1;
C = gallery('uniformdata',[5000 1],3)-1;
F= 1.10471*(X.^2).*A + 0.04811*B.*C.*14.0 + A ;
%%Define a regular grid, and grid the data to it:
d = -0.8:0.05:0.8;
%[xi,yi,zi] = meshgrid(d,d,d);
[Xi,Ai,Bi,Ci] = ndgrid(d,d,d,d);
w = griddata3(X,A,B,C,F,Xi,Ai,Bi,Ci);
%[X,A] = ndgrid(-2:.2:2, -2:.2:2);
%[X,A,B,C] = ndgrid( -2:.2:2, -2:.2:2);
% Since it is difficult to visualize 4-D data sets,
% use isosurface at 0.8:
p = patch(isosurface(Xi,Ai,Bi,Ci,w,0.8));
isonormals(Xi,Ai,Bi,Ci,w,p);
set(p,'FaceColor','blue','EdgeColor','none');
view(3), axis equal, axis off camlight, lighting phong
%F= 1.10471*X^2*A +0.04811*B*C*(14.0 + A);
%% F= X.^2*A + B.*C.*(14 + A);
%% mesh(F)
mesh(F)
...............
?? Error using ==> griddata3 at 51
METHOD must be one of 'linear', or 'nearest'.
Error in ==> testndgrid3 at 14
w = griddata3(X,A,B,C,F,Xi,Ai,Bi,Ci);
|