MATLAB Answers

0

How to select true values ?

Latest activity Commented on by madhan ravi
on 29 Oct 2018
I have 2 matrices and 4 conditions for it
like positive positive negative positive positive negative abd negative negative
i have converted them into indices matrix
and now it should go further when the answer is true
if true
% code
A=[-1,2,3,4,-5]
B= [-6,-7,8,9,10]
i1=A<0;i2=A>0;i3=B<0;i4=B>0;
for example in i1 and i3 how can select 1 and 1 on the same index
here -1 and -6 and the go further

  1 Comment

madhan ravi
on 29 Oct 2018
whats your desired result? give an example

Sign in to comment.

Tags

2 Answers

madhan ravi
Answer by madhan ravi
on 29 Oct 2018
 Accepted Answer

>> A=[-1,2,3,4,-5]
B= [-6,-7,8,9,10]
i1=A<0;
i2=A>0;
i3=B<0;
i4=B>0;
AA= A(i1 & i3)
BB=B(i2 & i4)
A =
-1 2 3 4 -5
B =
-6 -7 8 9 10
AA =
-1
BB =
8 9
>>

  1 Comment

madhan ravi
on 29 Oct 2018
Like the above maybe?

Sign in to comment.


Answer by Walter Roberson
on 29 Oct 2018

i1 & i3

  0 Comments

Sign in to comment.