pancho_hideboo
Advanced Member level 5
- Joined
- Oct 21, 2006
- Messages
- 2,847
- Helped
- 767
- Reputation
- 1,536
- Reaction score
- 733
- Trophy points
- 1,393
- Location
- Real Homeless
- Activity points
- 17,490
I would like to set zero for elements whose absolute is lesser than 10 in MATLAB Array.
Now I use following MATLAB code for this purpose.
However this is not cool.
Is there any cool method ?
Now I use following MATLAB code for this purpose.
However this is not cool.
Is there any cool method ?
Code:
>> A=[1000, 200, 3, 10]
A =
1000 200 3 10
>> for(i=1:length(A))
if abs(A(i)) < 10, A(i)=0; end
end
>> A
A =
1000 200 0 10
>>