Surf plot from excel file
1 回表示 (過去 30 日間)
古いコメントを表示
I am unsure on how to get this to upload to produce a surface plot. I have seen similar code such as the below but am unsure on how to convert this to function with mine
clc
clear all
T = readmatrix('C:\Users\natha\Downloads')
x = T(:,1)
y = T(:,2)
z = T(:,3)
[X,Y]=meshgrid(x,y)
surf(X,Y,z)
xlabel('X')
ylabel('Y')
zlabel('IDT Resonant Frequency')
0 件のコメント
回答 (1 件)
Star Strider
2024 年 3 月 8 日
It would help to know what the data are, and what you want to do with the NaN values.
That aside, just plot all but the first column as a matrix —
A1 = readmatrix('IDT results.xlsx')
figure
surfc(A1(:,2:end))
colormap(turbo)
xlabel('X')
ylabel('Y')
An alternative approach would be to create ‘x’ and ‘y’ vectors or lengths 17 and 9 and then use that with meshgrid or ndgrid to create (17x9) matrices to use with the scatteredInterpolant function.and the last 9 columns of the matrix (all reshaped to produce column vectors) to create an interpolated matrix.
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
