Excel data import 3D Plot

3 ビュー (過去 30 日間)
Kunter Özbay
Kunter Özbay 2020 年 12 月 31 日
コメント済み: Star Strider 2021 年 1 月 2 日
Hello everybody,
i have this excel below and i would like to plot a 3D graph (surface or sth like that) for the two axes (1-30 and 95 to 5 with 5 steps as axes). I have imported the data as cell array and tried the command below but i get an error that the dimensions not match. Then i delete the first row and columb from x and y to let them have the same dimension, still not working. Can anybody help me?
x = num(:,1) ;
y = num(1,:) ;
Z = num(2:end,2:end) ;
surfl(x,y,Z)

採用された回答

Star Strider
Star Strider 2020 年 12 月 31 日
Try this:
num = rand(5,7); % Create Matrix (To Test Code)
x = (1:size(num,1)).'; % Column Vector
y = (1:size(num,2)); % Row Vector
Z = num;
figure
surfl(x, y, Z.') % Transpose ‘Z’ And It Works!
.
  2 件のコメント
Kunter Özbay
Kunter Özbay 2021 年 1 月 2 日
I just realized with your answer, that i needed to manipulate the data a bit better to get the desired output. Thanks for leading the way :)
Star Strider
Star Strider 2021 年 1 月 2 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by