Plot a smooth graph from excel data

12 views (last 30 days)
sannatlegend
sannatlegend on 6 Jan 2017
Edited: sannatlegend on 8 Jan 2017
Hi,
I have to import three columns from excel, each column having over 50,000 data points. And I have to plot a three-dimensional plot. Can someone please help me by guiding me on which commands to use so that I can plot a smooth curve (like the attached diagram) from the excel data?

Answers (3)

Adam
Adam on 6 Jan 2017
doc xlsread
doc surf
  1 Comment
sannatlegend
sannatlegend on 7 Jan 2017
Adam, thank you for your reply. I have tried your commands, but still have some trouble. This was what I did to plot the graphs before your help.
figure;
tri1 = delaunay(shearexponent,temperature);
surf(tri1,shearexponent,temperature,windspeed);
xlabel('Wind Shear Exponent');
ylabel('Temperature (deg. Celsius)');
zlabel('Wind Speed (m/s)');

Sign in to comment.


Star Strider
Star Strider on 7 Jan 2017
If you have three columns and the independent variables (coordinates) are not gridded, you cannot plot them in a surf or mesh plot without interpolating them to a grid first. (see the documentation for the scatteredInterpolant class for details.)
One easy way to see if they are gridded is to use stem3 to plot them. The advantage of stem3 over the others (specifically scatter3 or plot3) is that stem3 shows you where the independent variable coordinates are located for each dependent variable. If they look gridded, you can then use the reshape function to produce the gridded coordinates that the surf and mesh functions require.

sannatlegend
sannatlegend on 8 Jan 2017
Edited: sannatlegend on 8 Jan 2017
Star Strider, thank you for your help. But I am still having some trouble understanding your statement.
The data points were measured by a LIDAR system, and I want to plot the 3D graph to see the dependence of shear exponent with wind speed and temperature.
What exactly do you mean by gridded? That one variable is a function on the other two? As in if I have two variables x and y, z = f(x,y)?
Apologies for any inconvenience, but I'm new to Matlab.

Categories

Find more on 2-D and 3-D Plots 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!