Find brings back empty matrix

2 次查看(过去 30 天)
When I use the find command the get back empty matrix: 0-by-1 for B and L,but I get an answer for R. help please thanks
This is my code
clear,clc
load rocket.dat
B= rocket(:,4);
R= rocket(:,2);
L= rocket(:,3);
(find(L<40 & L>60))
(find(B<100 & B>200))
(find(R<115 & R<125))
This is the data in rocket.dat for reference
1.0000000e+000 1.1600000e+002 4.5000000e+001 1.1000000e+002
2.0000000e+000 1.1400000e+002 4.2000000e+001 1.1500000e+002
3.0000000e+000 1.1800000e+002 4.1000000e+001 1.2000000e+002
4.0000000e+000 1.2400000e+002 3.8000000e+001 9.5000000e+001
5.0000000e+000 1.2600000e+002 6.1000000e+001 1.1800000e+002

采纳的回答

Ahmet Cecen
Ahmet Cecen 2014-11-20
That is because a number cant be bigger than 60 and lower than 40 at the same time:
L<40 & L>60
You need to figure out what range you are actually interested in, and either flip those inequalities or use OR instead of AND.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by