I have a matrix A
of an image with elements from 0 to 255. Now I want only the elements which are > 48
and < 200
to be changed to their square root.
I know I can find and replace elements like this:
A(A>48 & A<200) = 3;
But I don't want to set the elements to a number, I want to use the elements value for the new value.
Something like this:
A(A>48 & A<200).^(1/2)
The above syntax is obviously not correct, but I would like to calculate the square root of the elements which are > 48
and < 200
Is there a way without loops?