How to plot certain points (or select data of specified range)
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Azzi Abdelmalek
el 7 de Ag. de 2015
Editada: Azzi Abdelmalek
el 7 de Ag. de 2015
idx=M(:,1)<10 & M(:,1)>-10
out=M(idx,:)
plot(out(:,1),out(:,2))
2 comentarios
Azzi Abdelmalek
el 7 de Ag. de 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,:)]
Ver también
Categorías
Más información sobre Switches and Breakers en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!