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!
