Plot of discrete data
Afficher commentaires plus anciens
For example, I have 3 array Gain_10m=[24 27 28 34] Gain_20m=[28 29 31 35] Gain_30m=[30 34 35 38]
I want to plot the data so in X axis when the value of x is 10, they will 4 different value of y (24 27 28 34), then for 20 also have 4 different value of y(28 29 31 35) and so on.
Also, I want to give the legend of each column in, for example for (24 28 30) is 1 GHz, for (27 29 34) is 2 GHz.
How should I do? Thank you
Réponses (1)
Star Strider
le 19 Juil 2017
Try this:
Gain_10m=[24 27 28 34];
Gain_20m=[28 29 31 35];
Gain_30m=[30 34 35 38];
GainMtx = [Gain_10m; Gain_20m; Gain_30m]';
Freqv = 10:10:30;
figure(1)
plot(Freqv, GainMtx)
legend('1 GHz','2 GHz','Location','NW')
Catégories
En savoir plus sur Legend dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!