How to plot certain points (or select data of specified range)
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I want to plot the below data, but only between -10~+10. The raw data is always >-10 to >10. But I only need to plot between -10 &+10. How can I select between -10 ~+10. I also want to get the index of each filtered data between -10~10. Please kindly help. Many many thanks in advance.
-14 0.28
-13 0.27
-12 0.26
-11 0.25
-10 0.24
-9 0.23
-8 0.23
-7 0.22
-6 0.22
-5 0.22
-4 0.22
-3 0.22
-2 0.22
-1 0.22
0 0.23
1 0.22
2 0.22
3 0.22
4 0.22
5 0.22
6 0.22
7 0.23
8 0.23
9 0.23
10 0.24
11 0.26
12 0.29
0 commentaires
Réponses (1)
Azzi Abdelmalek
le 7 Août 2015
Modifié(e) : Azzi Abdelmalek
le 7 Août 2015
idx=M(:,1)<10 & M(:,1)>-10
out=M(idx,:)
plot(out(:,1),out(:,2))
2 commentaires
Azzi Abdelmalek
le 7 Août 2015
M=[-14 0.28
-13 0.27
-12 0.26
-11 0.25
-10 0.24
-9 0.23
-8 0.23
-7 0.22
-6 0.22
-5 0.22
-4 0.22
-3 0.22
-2 0.22
-1 0.22
0 0.23
1 0.22
2 0.22
3 0.22
4 0.22
5 0.22
6 0.22
7 0.23
8 0.23
9 0.23
10 0.24
11 0.26
12 0.29]
idx=M(:,1)<=10 & M(:,1)>=-10
out=[(1:nnz(idx))' M(idx,:)]
Voir également
Catégories
En savoir plus sur Switches and Breakers dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!