How to plot specific values from a matrix of 10*10

1 回表示 (過去 30 日間)
Nadeem Taj
Nadeem Taj 2021 年 9 月 26 日
回答済み: the cyclist 2021 年 9 月 26 日
I have a matrix of 10*10 with 5 columns having value >0 and other 5 columns have value=0. I just want to plot the output having values>0. Please suggest me a code. Thanks

回答 (1 件)

the cyclist
the cyclist 2021 年 9 月 26 日
M = [0 1 0 2;
0 2 0 3;
0 3 0 4];
colsToPlot = not(all(M==0));
figure
plot(M(:,colsToPlot))

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by