Surface Plot Excel Data

I have a file in excel with varying data in x, y & z independent of each other. How do I surface plot these ?? The A column is X data (shown in black), Row 1 is Y data (shown in Red) and the Z data is found out for each corresponding values of X and Y experimentally(shown in blue).
I did import the X and Y data from excel to matlab, also one of the Z data (column B) But not the entire Z data (blue). Any suggestions.
Quest.png

1 件のコメント

KSSV
KSSV 2019 年 6 月 12 日
Attach excel file....not as image.

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

回答 (1 件)

KSSV
KSSV 2019 年 6 月 12 日

3 投票

num = xlsread(myfile) ;
x = num(:,1) ;
y = num(1,:) ;
Z = num(2:end,2:end) ;
surf(x,y,Z) % if throws error trnspose Z

6 件のコメント

Aditya Chaugule
Aditya Chaugule 2019 年 6 月 13 日
Thanks, the Transpose worked !!
KSSV
KSSV 2019 年 6 月 13 日
Thanks is accepting and/or voting the answer ...:)
JEONGMIN KIM
JEONGMIN KIM 2021 年 6 月 9 日
thanks man
Hammad Masood
Hammad Masood 2022 年 2 月 7 日
I tried to do the above but got the following error,
Error using surf (line 71)
Data dimensions must agree.
Tried transposing but that isn't working also. Please help.
My file is also attached.
KSSV
KSSV 2022 年 2 月 7 日
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/886870/SA.xlsx') ;
z = table2array(T) ;
surf(z)
sameer kumar
sameer kumar 2023 年 2 月 7 日
How to restrict boundary?

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

タグ

質問済み:

2019 年 6 月 12 日

コメント済み:

2023 年 2 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by