Hello.
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
|
|
0
|
|
|
|
Reply
|
Carlos
|
12/15/2010 3:03:05 PM |
|
If you have access to Curve Fitting Toolbox, you can do the following
foo = fit(X,Y,Z, 'cubicinterp');
plot(foo)
"Carlos " <cddsc@yahoo.com> wrote in message
news:iealb9$dj0$1@fred.mathworks.com...
> Hello.
>
> 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
|
|
0
|
|
|
|
Reply
|
Richard_Willey
|
12/15/2010 3:46:12 PM
|
|
"Richard_Willey" <rwilley@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.
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
|
|
0
|
|
|
|
Reply
|
Carlos
|
12/15/2010 10:41:04 PM
|
|
"Carlos " <cddsc@yahoo.com> wrote in message
news:iebg60$33f$1@fred.mathworks.com...
> "Richard_Willey" <rwilley@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
slord@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
|
|
0
|
|
|
|
Reply
|
Steven_Lord
|
12/16/2010 3:50:49 AM
|
|
There is just a slight error in the syntax of that bit.
foo = fit([X,Y], Z, 'cubicinterp');
plot(foo)
thanks for the good idea to use the fit toolbox to do the lifting of the matrix creation.
"Richard_Willey" <rwilley@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)
>
>
> "Carlos " <cddsc@yahoo.com> wrote in message
> news:iealb9$dj0$1@fred.mathworks.com...
> > Hello.
> >
> > 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
|
|
0
|
|
|
|
Reply
|
jbittn2 (1)
|
5/17/2012 4:24:07 PM
|
|
|
4 Replies
1228 Views
(page loaded in 0.09 seconds)
Similiar Articles: Plot xyz surface data from matrix or file - comp.soft-sys.matlab ...Hello. 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, s... delaunay/trisurf question - comp.soft-sys.matlabPlot xyz surface data from matrix or file - comp.soft-sys.matlab ... delaunay/trisurf question - comp.soft-sys.matlab I'm using the delaunay triangulation for my surface ... Surface Plot - comp.soft-sys.matlabPlot xyz surface data from matrix or file - comp.soft-sys.matlab ... Hello. How can I do surface plot of xyz existent data in a matrix (column 1 = x, column 2 = y, column ... Plotting data from a file - comp.graphics.apps.gnuplotPlot xyz surface data from matrix or file - comp.soft-sys.matlab ... Hello. How can I do surface plot of xyz existent data in a matrix (column 1 = x, column 2 = y, column ... How to plot isolines from sampled data? - comp.soft-sys.matlab ...Plot xyz surface data from matrix or file - comp.soft-sys.matlab ... How to plot isolines from sampled data? - comp.soft-sys.matlab ... Plot xyz surface data from matrix ... Plotting data with nonuniform mesh/grid? - comp.soft-sys.matlab ...Plot xyz surface data from matrix or file - comp.soft-sys.matlab ... Plotting data with ... data to grid data - comp.graphics.apps ... Plot xyz surface data from matrix or ... EXPORTING XYZ POINTS COORDINATES INTO EXCEL - comp.cad.solidworks ...Plot xyz surface data from matrix or file - comp.soft-sys.matlab ... EXPORTING XYZ POINTS COORDINATES INTO EXCEL - comp.cad.solidworks ... conversion of scattered data to ... 3D plot - comp.soft-sys.math.scilabHello, I'm generating a CSV file for a digital elevation model. It works fine but I'd like to plot 3D plots (not surface ... as "list(z,color)" where "z" is data-matrix ... Converting Certain Data from Numeric Matrix to Text - comp.soft ...... Below is an example of the set of XYZ data I am ... to be shown as 'No Data' so it won't plot ... Extracting a matrix from disorganised data file - comp.soft-sys ... Extracting a matrix from disorganised data file - comp.soft-sys ...Extracting data from a 2D surface plot in Matlab - comp.soft-sys ... matrix from disorganised data file - comp.soft-sys ... Possible to extract data matrix from plot figure ... Plot xyz surface data from matrix or file - comp.soft-sys.matlab ...Hello. 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, s... Converting XYZ Data to a Matrix - Create Surface plots and Contour ...The bottom image shows a 3D Color Map Surface (Mesh) plot of the resultant matrix data with the original data overlapping the surface as a 3D XYZ Scatter plot. 7/25/2012 10:27:23 AM
|