From: mins alaa on
I would like to generate a 15 * 20 random matrix ranging from -2 and 2, and then find the maximum and minimum values inside the matrix. Then using loops, implement an approximation technique setting all matrix elements that exceed the value of 1.2 to the maximum while setting the elements below -1.2 to the minimum. Can someone help me please?
From: ImageAnalyst on
Here's a hint.

a = 69 * rand(13, 17) - 42
maxValue = max(max(a))
a(a > 12) = maxValue
% Now calculate the minValue and do basically the same thing.

I practically did it for you, but altered some things and left a
little bit for you to do. You really shouldn't need any more help
after this!

P.S. Not sure what you mean by "an approximation technique" or why you
need loops. What are you approximating/estimating??? Maybe you can
explain.
 | 
Pages: 1
Prev: kernel function
Next: drawing triangles