plot data X,y,z data as surface
Show older comments
Hi all.
I am trying to plot stress values with matlab. My file dataset is with 3 columns: x_coord, y_coord, stress (which correspond to the stress values).
I tried to use scatter but, obviously, it plot the data as a point which is not exactly what I want.
I used scatterinterpolant+surf and imagesc but the colorbar numbers are different from the real data, so I am not sure I am doing the right thing.
F = scatteredInterpolant(x_axis, y_axis,zvalue);
min_x_axis = min(x_axis);
min_y_axis = min(y_axis);
max_x_axis = max(x_axis);
max_y_axis = max(y_axis);
x= linspace(min_x_axis, max_x_axis, 100);
y = linspace(min_y_axis, max_y_axis, 100);
[X, Y] = ndgrid(x, y);
D = F(X, Y);
surf(X, Y, D, 'edgecolor', 'none');
Thanks to all who can help me.
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh 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!