how to find variable between a range?

조회 수: 3 (최근 30일)
suchismita
suchismita 2015년 12월 2일
댓글: suchismita 2015년 12월 2일
I have a matrix as A
A=rand(1,10);
so here i have a set 10 of numbers i want to find the values which are greater than 0.4 and less than 0.8
for example,
>> rand(1,10)
ans =
Columns 1 through 9
0.8147 0.9058 0.1270 0.9134 0.6324 0.0975 0.2785 0.5469 0.9575
Column 10
0.9649
Answer i want is as [0000100111]. Hopefully i am able to clarify my question. please i need help. thank you
suchi

채택된 답변

Torsten
Torsten 2015년 12월 2일
B = (A>0.4) && (A<0.8);
(although I don't understand the last two ones in your answer vector).
Best wishes
Torsten.
  댓글 수: 2
Thorsten
Thorsten 2015년 12월 2일
should be &, not &&
suchismita
suchismita 2015년 12월 2일
thank u so much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by