Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Error using ==> griddata3 at 51..................... METHOD must be

Subject: Error using ==> griddata3 at 51..................... METHOD must be

From: Mark L. J.

Date: 10 Jan, 2013 05:00:31

Message: 1 of 2

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);

Subject: Error using ==> griddata3 at 51..................... METHOD must be

From: Roger Stafford

Date: 10 Jan, 2013 06:58:09

Message: 2 of 2

"Mark L. J." <abejohno@gmail.com> wrote in message <6002b0cd-7374-4249-93be-aa8bd880eb04@googlegroups.com>...
> ?? 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);
- - - - - - - - - - -
  Read your error message very carefully; then consult the documentation for 'griddata3'.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us