Thread Subject: given data points, making a 3D surface plot

Subject: given data points, making a 3D surface plot

From: Christopher

Date: 7 Jul, 2009 02:43:01

Message: 1 of 5

Im trying to plot those data points(from turbine blade) to 3D surface graph and the following is the data sheet

X Y Z
a=[1.5 0 0;
1.490907 0.0008145 0;
1.4792265 0.0016515 0;
1.4649975 0.0026805 0;
1.4482725 0.0039855 0;
1.42911 0.0056055 0;
1.4075775 0.007584 0;
1.38375 0.0099585 0;
1.3577115 0.0127635 0;
1.3295535 0.016035 0;
1.299375 0.019806 0;
1.267284 0.0241035 0;
1.2333915 0.02895 0;
1.1978175 0.034368 0;
1.1606865 0.040371 0;
1.1221305 0.046968 0;
1.082286 0.054165 0;
1.041291 0.0619545 0;
0.9992895 0.070329 0;
0.9564315 0.079269 0;
0.9128685 0.088746 0;
0.8687505 0.0987195 0;
0.824235 0.109134 0;
0.7794795 0.119901 0;
0.7346385 0.130914 0;
0.689874 0.1420515 0;
0.645339 0.153174 0;
0.601194 0.1638735 0;
0.5575935 0.1729425 0;
0.5146905 0.179244 0;
0.472635 0.1829115 0;
0.431577 0.184176 0;
0.391659 0.1832775 0;
0.353025 0.180396 0;
0.315807 0.1757325 0;
0.280137 0.1695015 0;
0.2461425 0.161883 0;
0.213942 0.153036 0;
0.183648 0.143145 0;
0.1553685 0.132426 0;
0.1292025 0.121068 0;
0.105243 0.1092375 0;
0.0835725 0.097095 0;
0.064269 0.084792 0;
0.0473985 0.072477 0;
0.0330225 0.060291 0;
0.0211905 0.048333 0;
0.0119445 0.0365535 0;
0.005316 0.0246195 0;
0.0013305 0.0121215 0;
0 0 0;
0.0013305 -0.0121215 0;
0.005316 -0.023295 0;
0.0119445 -0.033207 0;
0.0211905 -0.040908 0;
0.0330225 -0.0456825 0;
0.0473985 -0.047316 0;
0.064269 -0.046803 0;
0.0835725 -0.0451575 0;
0.105243 -0.042831 0;
0.1292025 -0.039999 0;
0.1553685 -0.0367935 0;
0.183648 -0.0333165 0;
0.213942 -0.0296505 0;
0.2461425 -0.025869 0;
0.280137 -0.0220335 0;
0.315807 -0.018198 0;
0.353025 -0.014412 0;
0.391659 -0.0107265 0;
0.431577 -0.007173 0;
0.472635 -0.003798 0;
0.5146905 -0.0006375 0;
0.5575935 0.002274 0;
0.601194 0.0048975 0;
0.645339 0.0071895 0;
0.689874 0.009096 0;
0.7346385 0.0104955 0;
0.7794795 0.011328 0;
0.824235 0.011703 0;
0.8687505 0.011739 0;
0.9128685 0.011508 0;
0.9564315 0.011064 0;
0.9992895 0.010452 0;
1.041291 0.0097155 0;
1.082286 0.0088905 0;
1.1221305 0.00801 0;
1.1606865 0.0071025 0;
1.1978175 0.006195 0;
1.2333915 0.005307 0;
1.267284 0.0044595 0;
1.299375 0.0036645 0;
1.3295535 0.0029325 0;
1.3577115 0.0022725 0;
1.38375 0.001689 0;
1.4075775 0.0011835 0;
1.42911 0.0007575 0;
1.4482725 0.0004095 0;
1.4649975 0.0001395 0;
1.4792265 -0.000057 0;
1.490907 -0.0001455 0;
0 0 1;
0.0151625 0.0296125 1;
0.0305875 0.042225 1;
0.061575 0.0595875 1;
0.0925875 0.07445 1;
0.1236375 0.0873 1;
0.18585 0.1059 1;
0.248175 0.117125 1;
0.372975 0.1301875 1;
0.498025 0.126275 1;
0.623275 0.110725 1;
0.7486125 0.08855 1;
0.874 0.0637625 1;
0.999375 0.0403375 1;
1.124675 0.0208 1;
1.187325 0.0114 1;
1.25 0 1;
0.0159 -0.0175 1;
0.03155 -0.0190125 1;
0.0627375 -0.015275 1;
0.093925 -0.0115375 1;
0.12515 -0.0098 1;
0.18755 -0.003575 1;
0.2499625 0.002025 1;
0.3748875 0.0076 1;
0.4998625 0.009175 1;
0.6248875 0.007125 1;
0.7499375 0.00395 1;
0.874975 0.001275 1;
1.0000125 -0.00065 1;
1.125 0.00005 1;
1.1875125 -0.0006 1;
0 0 2;
0.01219 0.02039 2;
0.02459 0.02648 2;
0.04943 0.03696 2;
0.0743 0.04534 2;
0.09919 0.05263 2;
0.14908 0.0598 2;
0.19903 0.06317 2;
0.29896 0.0674 2;
0.39898 0.06624 2;
0.49905 0.06199 2;
0.59919 0.05233 2;
0.69936 0.04167 2;
0.79957 0.02771 2;
0.89977 0.01496 2;
0.94988 0.00773 2;
1 0.0016 2;
0.01274 -0.0157 2;
0.02526 -0.01661 2;
0.0502 -0.01303 2;
0.07516 -0.01054 2;
0.10013 -0.00856 2;
0.15008 -0.00509 2;
0.20003 -0.00222 2;
0.29996 0.00252 2;
0.39993 0.00456 2;
0.49994 0.004 2;
0.59996 0.00284 2;
0.69997 0.00178 2;
0.79998 0.00122 2;
0.9 0.00006 2;
0.95002 -0.00107 2]
----------------------------------------------------------------------
and here's my code:
>>x= a(:,1);
y=a(:,2);
z=a(:,3);
dx=1;
dy=1;
x=edge=[floor(min(x)):dx:ceil(max(x))];
y=edge=[floor(min(y)):dy:ceil(max(y))];
[X,Y]=meshgrid(x_edge,y_edge);
Z=griddata(x,y,z,X,Y);
surf(X,Y,Z)
----------------------------------------------------------------------
however, all I got was a single point...can anyone tell me what did wrong?? I would be really appreciate it~ thanks for the help

Subject: given data points, making a 3D surface plot

From: Ashish Uthama

Date: 7 Jul, 2009 18:18:26

Message: 2 of 5

On Mon, 06 Jul 2009 22:43:01 -0400, Christopher <chris_nung@hotmail.com>
wrote:

> Im trying to plot those data points(from turbine blade) to 3D surface
> graph and the following is the data sheet
>
> X Y Z
> a=[1.5 0 0;
> 1.490907 0.0008145 0;
> 1.4792265 0.0016515 0;
> 1.4649975 0.0026805 0;
> 1.4482725 0.0039855 0;
> 1.42911 0.0056055 0;
> 1.4075775 0.007584 0;
> 1.38375 0.0099585 0;
> 1.3577115 0.0127635 0;
> 1.3295535 0.016035 0;
> 1.299375 0.019806 0;
> 1.267284 0.0241035 0;
> 1.2333915 0.02895 0;
> 1.1978175 0.034368 0;
> 1.1606865 0.040371 0;
> 1.1221305 0.046968 0;
> 1.082286 0.054165 0;
> 1.041291 0.0619545 0;
> 0.9992895 0.070329 0;
> 0.9564315 0.079269 0;
> 0.9128685 0.088746 0;
> 0.8687505 0.0987195 0;
> 0.824235 0.109134 0;
> 0.7794795 0.119901 0;
> 0.7346385 0.130914 0;
> 0.689874 0.1420515 0;
> 0.645339 0.153174 0;
> 0.601194 0.1638735 0;
> 0.5575935 0.1729425 0;
> 0.5146905 0.179244 0;
> 0.472635 0.1829115 0;
> 0.431577 0.184176 0;
> 0.391659 0.1832775 0;
> 0.353025 0.180396 0;
> 0.315807 0.1757325 0;
> 0.280137 0.1695015 0;
> 0.2461425 0.161883 0;
> 0.213942 0.153036 0;
> 0.183648 0.143145 0;
> 0.1553685 0.132426 0;
> 0.1292025 0.121068 0;
> 0.105243 0.1092375 0;
> 0.0835725 0.097095 0;
> 0.064269 0.084792 0;
> 0.0473985 0.072477 0;
> 0.0330225 0.060291 0;
> 0.0211905 0.048333 0;
> 0.0119445 0.0365535 0;
> 0.005316 0.0246195 0;
> 0.0013305 0.0121215 0;
> 0 0 0;
> 0.0013305 -0.0121215 0;
> 0.005316 -0.023295 0;
> 0.0119445 -0.033207 0;
> 0.0211905 -0.040908 0;
> 0.0330225 -0.0456825 0;
> 0.0473985 -0.047316 0;
> 0.064269 -0.046803 0;
> 0.0835725 -0.0451575 0;
> 0.105243 -0.042831 0;
> 0.1292025 -0.039999 0;
> 0.1553685 -0.0367935 0;
> 0.183648 -0.0333165 0;
> 0.213942 -0.0296505 0;
> 0.2461425 -0.025869 0;
> 0.280137 -0.0220335 0;
> 0.315807 -0.018198 0;
> 0.353025 -0.014412 0;
> 0.391659 -0.0107265 0;
> 0.431577 -0.007173 0;
> 0.472635 -0.003798 0;
> 0.5146905 -0.0006375 0;
> 0.5575935 0.002274 0;
> 0.601194 0.0048975 0;
> 0.645339 0.0071895 0;
> 0.689874 0.009096 0;
> 0.7346385 0.0104955 0;
> 0.7794795 0.011328 0;
> 0.824235 0.011703 0;
> 0.8687505 0.011739 0;
> 0.9128685 0.011508 0;
> 0.9564315 0.011064 0;
> 0.9992895 0.010452 0;
> 1.041291 0.0097155 0;
> 1.082286 0.0088905 0;
> 1.1221305 0.00801 0;
> 1.1606865 0.0071025 0;
> 1.1978175 0.006195 0;
> 1.2333915 0.005307 0;
> 1.267284 0.0044595 0;
> 1.299375 0.0036645 0;
> 1.3295535 0.0029325 0;
> 1.3577115 0.0022725 0;
> 1.38375 0.001689 0;
> 1.4075775 0.0011835 0;
> 1.42911 0.0007575 0;
> 1.4482725 0.0004095 0;
> 1.4649975 0.0001395 0;
> 1.4792265 -0.000057 0;
> 1.490907 -0.0001455 0;
> 0 0 1;
> 0.0151625 0.0296125 1;
> 0.0305875 0.042225 1;
> 0.061575 0.0595875 1;
> 0.0925875 0.07445 1;
> 0.1236375 0.0873 1;
> 0.18585 0.1059 1;
> 0.248175 0.117125 1;
> 0.372975 0.1301875 1;
> 0.498025 0.126275 1;
> 0.623275 0.110725 1;
> 0.7486125 0.08855 1;
> 0.874 0.0637625 1;
> 0.999375 0.0403375 1;
> 1.124675 0.0208 1;
> 1.187325 0.0114 1;
> 1.25 0 1;
> 0.0159 -0.0175 1;
> 0.03155 -0.0190125 1;
> 0.0627375 -0.015275 1;
> 0.093925 -0.0115375 1;
> 0.12515 -0.0098 1;
> 0.18755 -0.003575 1;
> 0.2499625 0.002025 1;
> 0.3748875 0.0076 1;
> 0.4998625 0.009175 1;
> 0.6248875 0.007125 1;
> 0.7499375 0.00395 1;
> 0.874975 0.001275 1;
> 1.0000125 -0.00065 1;
> 1.125 0.00005 1;
> 1.1875125 -0.0006 1;
> 0 0 2;
> 0.01219 0.02039 2;
> 0.02459 0.02648 2;
> 0.04943 0.03696 2;
> 0.0743 0.04534 2;
> 0.09919 0.05263 2;
> 0.14908 0.0598 2;
> 0.19903 0.06317 2;
> 0.29896 0.0674 2;
> 0.39898 0.06624 2;
> 0.49905 0.06199 2;
> 0.59919 0.05233 2;
> 0.69936 0.04167 2;
> 0.79957 0.02771 2;
> 0.89977 0.01496 2;
> 0.94988 0.00773 2;
> 1 0.0016 2;
> 0.01274 -0.0157 2;
> 0.02526 -0.01661 2;
> 0.0502 -0.01303 2;
> 0.07516 -0.01054 2;
> 0.10013 -0.00856 2;
> 0.15008 -0.00509 2;
> 0.20003 -0.00222 2;
> 0.29996 0.00252 2;
> 0.39993 0.00456 2;
> 0.49994 0.004 2;
> 0.59996 0.00284 2;
> 0.69997 0.00178 2;
> 0.79998 0.00122 2;
> 0.9 0.00006 2;
> 0.95002 -0.00107 2]
> ----------------------------------------------------------------------
> and here's my code:
>>> x= a(:,1);
> y=a(:,2);
> z=a(:,3);
> dx=1;
> dy=1;
> x=edge=[floor(min(x)):dx:ceil(max(x))];
> y=edge=[floor(min(y)):dy:ceil(max(y))];
> [X,Y]=meshgrid(x_edge,y_edge);
> Z=griddata(x,y,z,X,Y);
> surf(X,Y,Z)
> ----------------------------------------------------------------------
> however, all I got was a single point...can anyone tell me what did
> wrong?? I would be really appreciate it~ thanks for the help

Inspect your data.
What is your x and y ranges? (x/y_edge)
What is the resolution you want between this range?

You are currently asking for a resolution/stepsize of 1. Does that make
sense given the range?

try the code with:
dx=.05;
dy=.05;

Subject: given data points, making a 3D surface plot

From: Luigi Giaccari

Date: 8 Jul, 2009 18:36:04

Message: 3 of 5

Your lucky day:

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

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

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

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

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

Subject: given data points, making a 3D surface plot

From: Christopher

Date: 8 Jul, 2009 20:43:03

Message: 4 of 5

"Ashish Uthama" <first.last@mathworks.com> wrote in message <op.uwpmg0oua5ziv5@uthamaa.dhcp.mathworks.com>...
> On Mon, 06 Jul 2009 22:43:01 -0400, Christopher <chris_nung@hotmail.com>
> wrote:
> > Inspect your data.
> What is your x and y ranges? (x/y_edge)
> What is the resolution you want between this range?
>
> You are currently asking for a resolution/stepsize of 1. Does that make
> sense given the range?
>
> try the code with:
> dx=.05;
> dy=.05;
sorry that was a typo

x= a(:,1);
y=a(:,2);
z=a(:,3);
dx=0.05;
dy=0.05;
x_edge=[floor(min(x)):dx:ceil(max(x))];
y_edge=[floor(min(y)):dy:ceil(max(y))];
[X,Y]=meshgrid(x_edge,y_edge);
Z=griddata(x,y,z,X,Y);
surf(X,Y,Z)

Subject: given data points, making a 3D surface plot

From: AJAY PAN

Date: 10 Jan, 2011 21:50:08

Message: 5 of 5


I am using this code to plot my data but i am getting an error

a= [40 70 0.2154
40 65 0.2117
40 50 0.1925
35 70 0.1834
35 65 0.1815
35 50 0.1591
30 65 0.1508
30 55 0.1479
30 50 0.1460
25 65 0.1242
25 50 0.1236
20 70 0.1140
20 65 0.1141
20 50 0.1141
15 70 0.1323
15 50 0.1303
10 70 0.1730
10 50 0.1724
];
x= a(:,1);
y=a(:,2);
z=a(:,3);
dx=0.2;
dy=0.2;
x_edge=[floor(min(x)):dx:ceil(max(x))];
y_edge=[floor(min(y)):dy:ceil(max(y))];
[X,Y]=meshgrid(x_edge,y_edge);
Z=griddata(x,y,z,X,Y);
surf(X,Y,Z)
??? Error using ==> qhullmx
qhull precision error: initial simplex is not convex. Distance=-1.1e-014


While executing: | qhull d Qt Qbb Qc


I need help in plotting this data please let meknow.

Thanks






"Christopher " <chris_nung@hotmail.com> wrote in message <h330cm$c7$1@fred.mathworks.com>...
> "Ashish Uthama" <first.last@mathworks.com> wrote in message <op.uwpmg0oua5ziv5@uthamaa.dhcp.mathworks.com>...
> > On Mon, 06 Jul 2009 22:43:01 -0400, Christopher <chris_nung@hotmail.com>
> > wrote:
> > > Inspect your data.
> > What is your x and y ranges? (x/y_edge)
> > What is the resolution you want between this range?
> >
> > You are currently asking for a resolution/stepsize of 1. Does that make
> > sense given the range?
> >
> > try the code with:
> > dx=.05;
> > dy=.05;
> sorry that was a typo
>
> x= a(:,1);
> y=a(:,2);
> z=a(:,3);
> dx=0.05;
> dy=0.05;
> x_edge=[floor(min(x)):dx:ceil(max(x))];
> y_edge=[floor(min(y)):dy:ceil(max(y))];
> [X,Y]=meshgrid(x_edge,y_edge);
> Z=griddata(x,y,z,X,Y);
> surf(X,Y,Z)

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com