Surface plot from excel data

3 ビュー (過去 30 日間)
Patrick Chen
Patrick Chen 2021 年 8 月 2 日
コメント済み: Patrick Chen 2021 年 8 月 3 日
I have a file in excel with varying data in x, y & z independent of each other. How do I surface plot these ??
I did import the X and Y data from excel to matlab, also one of the Z data but not the entire Z data, but shows errror on trisurf(tri,x,y,z); any suggestions?
function plot3Ddata(x,y,z)
test = xlsread('test1.xlsx', 'O2:Q3722');
x=test(:,1);
y=test(:,2);
z=test(:,3);
tri = delaunay(x,y);
trisurf(tri,x,y,z);
end

採用された回答

David Hill
David Hill 2021 年 8 月 2 日
a=readmatrix('test1.xlsx');
x=a(1,2:end);
y=a(2:end,1);
z=a(2:end,2:end);
[X,Y]=meshgrid(x,y);
surf(X,Y,z)
  1 件のコメント
Patrick Chen
Patrick Chen 2021 年 8 月 3 日
Thanks a lot with the help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePurple についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by