tombraided
Newbie level 2
Hi there,
I would like to impose two condition on a matrix
1. if the value is less than -1, then the value of respective element will be zero
2. if the value is greater than 1, then the value of respective element will be zero
I need to do it by one command (I don't want to use for loop since it would make the program slow)
Thanks in advance.
---------- Post added at 22:06 ---------- Previous post was at 21:50 ----------
I have got the solution.
Condition can be imposed by using '&'
If 'a' is a matrix containing random numbers. Then the command should be
a>=-1 & a<=1
Thank you for your interest.
I would like to impose two condition on a matrix
1. if the value is less than -1, then the value of respective element will be zero
2. if the value is greater than 1, then the value of respective element will be zero
I need to do it by one command (I don't want to use for loop since it would make the program slow)
Thanks in advance.
---------- Post added at 22:06 ---------- Previous post was at 21:50 ----------
I have got the solution.
Condition can be imposed by using '&'
If 'a' is a matrix containing random numbers. Then the command should be
a>=-1 & a<=1
Thank you for your interest.