Find brings back empty matrix
조회 수: 1 (최근 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
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!