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:
Griddata Question

Subject: Griddata Question

From: Dave

Date: 29 Jul, 2009 14:24:01

Message: 1 of 3

I am using griddata as follows:

ZI = griddata(x_final,y_final,z_final,XI,YI);

When I use surf(ZI), my surface is plotted at the origin.
When I use surf(XI,YI,ZI), my surface is plotted at XI,YI coordinates (duh!)

Is there a way to use surf(ZI) with the XI,YI data coordinates somehow embedded? MATLAB says: "...griddata returns the values for the corresponding points (XI(i,j),YI(i,j))."

Am I thinking about this incorrectly? Thanks

Subject: Griddata Question

From: Dave Brackett

Date: 29 Jul, 2009 21:47:01

Message: 2 of 3

"Dave " <dss45@drexel.edu> wrote in message <h4pm21$ikr$1@fred.mathworks.com>...
> I am using griddata as follows:
>
> ZI = griddata(x_final,y_final,z_final,XI,YI);
>
> When I use surf(ZI), my surface is plotted at the origin.
> When I use surf(XI,YI,ZI), my surface is plotted at XI,YI coordinates (duh!)
>
> Is there a way to use surf(ZI) with the XI,YI data coordinates somehow embedded? MATLAB says: "...griddata returns the values for the corresponding points (XI(i,j),YI(i,j))."
>
> Am I thinking about this incorrectly? Thanks

I don't think I entirely follow what you mean, but you can get the XIij and YIij outputs from griddata like this:
[XIij,YIij,ZI] = griddata(x_final,y_final,z_final,XI,YI)

Then use surf(XIij, YIij, ZI)

Apologies if that does not address your question. If it doesn't could you explain more clearly what you are trying to do please?

Subject: Griddata Question

From: Luigi Giaccari

Date: 31 Jul, 2009 10:49:01

Message: 3 of 3

"Dave " <dss45@drexel.edu> wrote in message <h4pm21$ikr$1@fred.mathworks.com>...
> I am using griddata as follows:
>
> ZI = griddata(x_final,y_final,z_final,XI,YI);
>
> When I use surf(ZI), my surface is plotted at the origin.
> When I use surf(XI,YI,ZI), my surface is plotted at XI,YI coordinates (duh!)
>
> Is there a way to use surf(ZI) with the XI,YI data coordinates somehow embedded? MATLAB says: "...griddata returns the values for the corresponding points (XI(i,j),YI(i,j))."
>
> Am I thinking about this incorrectly? Thanks

Maybe you can find interesting this alternative:

http://www.mathworks.com/matlabcentral/fileexchange/23447

http://www.advancedmcode.org/
http://giaccariluigi.altervista.org/blog/

Tags for 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