Surface Plot using excel file as a source
이전 댓글 표시
Hello,
I am a new user to Matlab and I am trying to create a surface plot for data analysis, so it would be great if you can assist a fellow newbie.
Attached you will find a sample xls file .
When I am running the below script I am getting an error with the message "Data dimensions must agree."
Did I miss something? Thanks in advance and any help will be much appreciated.
filename = PlotData.xlsx';
num = xlsread(filename) ;
x = num(2:end,1) ;
y = num(1,2:end) ;
Z = num(2:end,2:end) ;
surf(x,y,Z)
채택된 답변
추가 답변 (1개)
KSSV
2021년 5월 19일
x = A(1,2:end) ;
y = A(2:end,1) ;
Z = A(2:end,2:end) ;
surf(x,y,Z) ;
댓글 수: 2
KSSV
2021년 5월 19일
surf(x,y,Z')
or
surf(y,x,Z)
The above also will work along with the answer given.
Andreas Kerasiotis
2021년 5월 20일
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!