How to plot 3d surface plot from excel data
30 次查看(过去 30 天)
显示 更早的评论
clc
clear all
T = readmatrix('C:\Users\visha\Desktop\Data set.xlsx')
x = T(:,1)
y = T(:,2)
z = T(:,3)
[X,Y]=meshgrid(x,y)
surf(X,Y,z)
xlabel('X')
ylabel('Y')
zlabel('Plastic Strain')
0 个评论
采纳的回答
Tala
2022-3-29
编辑:Tala
2022-3-29
Use this:
T = readmatrix('Data.xlsx');
x = T(:,1);
y = T(:,2);
z = T(:,3);
[Ux,iax,ixx] = unique(x);
[Uy,iay,ixy] = unique(y);
N = 25; % adjust
xv = linspace(min(x), max(x), N);
yv = linspace(min(y), max(y), N);
[Xm,Ym] = ndgrid(xv, yv);
Zm = griddata(x, y, z, Xm, Ym);
figure
surfc(Xm, Ym, Zm)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!