How can I do surface plot of xyz existent data in a matrix (column 1 = x, column 2 = y, column 3 = z)?
I don't want calculate anything, so I don't want to do the usual "tuturial" example of:
[vX,vY]=meshgrid(x,y)
vZ = function(vX,vY)
surf(vX,vY,vZ)
And the intervals in x axis (or y axis) are not constant over the domain
So I just want to plot existent x y z data which are a matrix like this
0 0 0
0 0.000267 0
0 0.000534 0
0 0.000801 0
0 0.001068 0
0 0.001335 0
0.0006 0 0
0.0006 0.000267 0.13304
0.0006 0.000534 0.19506
0.0006 0.000801 0.19506
0.0006 0.001068 0.13304
0.0006 0.001335 1.6067e-016
0.0012 0 0
0.0012 0.000267 0.16342
0.0012 0.000534 0.2439
0.0012 0.000801 0.2439
0.0012 0.001068 0.16342
0.0012 0.001335 1.9014e-016
0.0018 0 0
0.0018 0.000267 0.17079
0.0018 0.000534 0.25582
0.0018 0.000801 0.25582
0.0018 0.001068 0.17079
0.0018 0.001335 1.9725e-016
and obtain a figure like the one in this url:
http://peniche-online.com/images/gnuplot.jpg
which was obtained with gnuplot using a file where the matrix was dumped.
Thanks,
carlos
foo = fit(X,Y,Z, 'cubicinterp');
plot(foo)
"Carlos " <cd...@yahoo.com> wrote in message
news:iealb9$dj0$1...@fred.mathworks.com...
Hi!
Thanks for your answer.
I think I have the curving tool box, but for some unknown reason to me (I don't understant very much about matlab) the fit function generates errors.
However, and despite I doubt the graphic quality I get something what I want using the griddata and surf functions that I saw somewhere while researching in the net (probably following links from fit or surf functions):
yvector = perfil_vector(:,5);
zvector = perfil_vector(:,7);
vvector = perfil_vector(:,8);
yi = 0:0.00001:0.03;
zi = 0:0.000001:0.001335;
[YI,ZI] = meshgrid(yi,zi);
VI = griddata(yvector,zvector,vvector,YI,ZI);
mesh(YI,ZI,VI), hold
%plot3(yvector,zvector,vvector,'o'), hold off
surf(YI,ZI,VI);
shading flat;
http://peniche-online.com/images/matlab.jpg
"Carlos " <cd...@yahoo.com> wrote in message
news:iebg60$33f$1...@fred.mathworks.com...
> "Richard_Willey" <rwi...@mathworks.com> wrote in message
> <ieans8$8nf$1...@fred.mathworks.com>...
>> If you have access to Curve Fitting Toolbox, you can do the following
>>
>> foo = fit(X,Y,Z, 'cubicinterp');
>> plot(foo)
>>
>>
>
>
> Hi!
> Thanks for your answer.
> I think I have the curving tool box, but for some unknown reason to me (I
> don't understant very much about matlab) the fit function generates
> errors.
Show the group how exactly you call FIT and the exact full text of the error
message you received and someone may be able to offer a suggestion.
*snip*
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com