Error with surf function

4 ビュー (過去 30 日間)
Khaled Mahmoud
Khaled Mahmoud 2020 年 8 月 11 日
コメント済み: Khaled Mahmoud 2020 年 8 月 11 日
Hello,
I have the following data dimentions:
x = linspace(1,16,256)
y = linspace(1,16,256)
size( data ) = 256 x 16
I want to plot this as a 3D using surf function. I tried to use surf( x, y, data), but I got an error due to the length of the vectors. Does any body know how can I plot it proberly?

採用された回答

KSSV
KSSV 2020 年 8 月 11 日
[m,n] = size(data) ;
x = 1:n ;
y = 1:m ;
surf(x,y,data)
Also you can straight away use:
surf(data) ;
  1 件のコメント
Khaled Mahmoud
Khaled Mahmoud 2020 年 8 月 11 日
Thanks

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

その他の回答 (1 件)

Alan Stevens
Alan Stevens 2020 年 8 月 11 日
Try
x = linspace(1,16,16);
y = linspace(1,256,256);
surf(x,y,data)
  1 件のコメント
Khaled Mahmoud
Khaled Mahmoud 2020 年 8 月 11 日
Thanks

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by