How to plot a 3d graph with z axis, not the same length as x,y from, the data is imported from an excel sheet ?
1 次查看(过去 30 天)
显示 更早的评论
I have data from an experiment as attached, how can I import the data from the excel sheet and then build a surface 3-d graph?
0 个评论
回答(1 个)
Dyuman Joshi
2023-3-28
编辑:Dyuman Joshi
2023-3-28
out=readmatrix('Test1.xlsx')
%Extracting x, y and z data
x = out(1,2:end);
y = out(3:end,1);
Z = out(3:end,2:end);
%Create a mesh
[X,Y]=meshgrid(x,y);
%Draw a surface graph
surf(X,Y,Z)
%You can also extract data via readmatrix() and the range of data from excel
x0 = readmatrix('Test1.xlsx','Range','C2:P2')
%similarly y0 = readmatrix('Test1.xlsx','Range','C4:C21')
%z0 = readmatrix('Test1.xlsx','Range','C4:P21')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!