Plot of discrete data
Mostra commenti meno recenti
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
Risposte (1)
Star Strider
il 19 Lug 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')
Categorie
Scopri di più su Legend in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!