필터 지우기
필터 지우기

Find brings back empty matrix

조회 수: 2 (최근 30일)
benny
benny 2014년 11월 20일
편집: Azzi Abdelmalek 2014년 11월 20일
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