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

1 vue (au cours des 30 derniers jours)
Nadeem Taj
Nadeem Taj le 26 Sep 2021
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

Réponses (1)

the cyclist
the cyclist le 26 Sep 2021
M = [0 1 0 2;
0 2 0 3;
0 3 0 4];
colsToPlot = not(all(M==0));
figure
plot(M(:,colsToPlot))

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by