Clear Filters
Clear Filters

I wanted to plot a surfc plot of the attached data. It has x,y and z data.The data corresponds to a 2D scan of a circular cross section.

1 view (last 30 days)
I wanted to plot a surfc plot of the attached data. It has x,y and z data.The data corresponds to a 2D scan of a circular cross section (density measurements at each (x=-65 to +65mm,y=-65 to +65mm) location). Note that there is an assymetry in the data points available at each location. Eg. at x=0mm,y has 27 data points from -65 to +65.But at x= 65mm only 9 y datas are available from +15 mm to -25 mm due to the experimental limitation. How can I plot surfc or contourf plot for this data. ? This can be very easily done in origin, but how to do in matlab ?

Accepted Answer

darova
darova on 29 Sep 2019
Just use griddata()
xq = linspace( min(x),max(x),30 );
yq = linspace( min(y),max(y),30 );
[X,Y] = meshgrid(xq,yq);
Z = griddata(x,y,z,X,Y);
surf(X,Y,Z)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!