plotting a matrix in matlab

I have a 10 in 10 matrix. I want to plot the matrix in the way that each elements present the number. can you help me with that?

回答 (1 件)

Star Strider
Star Strider 2020 年 5 月 2 日

0 投票

I have no idea what result you want.
Try these:
M = randi(99, 10); % Create Matrix
[X,Y] = ndgrid(1:10);
figure
stem3(X(:), Y(:), M(:), 'filled')
grid on
figure
bar3(M)
grid on
.

2 件のコメント

talayeh tavangar
talayeh tavangar 2020 年 5 月 2 日
Thanks I mean I want to creat a surfaca and has 100 grids and each grid present the next one of the matrix element. I tried your code but it is 3D chart
Star Strider
Star Strider 2020 年 5 月 2 日
My pleasure!
Still guessing what you want.
Try this:
figure
imagesc(M)
and this:
figure
surf(M)
view(0, 90)
.

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

カテゴリ

ヘルプ センター および File ExchangeGraphics Object Properties についてさらに検索

タグ

質問済み:

2020 年 5 月 2 日

コメント済み:

2020 年 5 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by