Is there an example available for the GRIDDATA3 function in MATLAB 7.0.1 (R14SP1) documentation?
2 views (last 30 days)
Show older comments
I would like to see an example of how to use the GRIDDATA3 function in MATLAB 7.0.1 (R14SP1).
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This enhancement has been incorporated in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
As an example, assume we have scattered points in 3-space "(x, y, z)", and their corresponding function value "v = v(x,y,z)". Some sample data can be created using:
x = rand(5,5);
y = rand(5,5);
z = rand(5,5);
v = rand(5,5);
plot3(x,y,z,'.')
Here you can interpolate the function "v" at a set of gridded data points using GRIDDATA3. For example,
[X Y Z] = meshgrid(0:.1:1); % Create gridded data
v = griddata3(x,y,z,v,X,Y,Z); % Interpolate v at the gridded data points.
Now you have the function value at the gridded data points, i.e. "v = % v(X,Y,Z)".
0 Comments
More Answers (0)
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!