MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by jenifer
on 30 Jan 2013

hi.. i want normalize a matrix (129 x 128)..please help me with matlab codes

*No products are associated with this question.*

Answer by Thorsten
on 30 Jan 2013

Accepted answer

To normalize a matrix such that all values fall in the range [0, 1] use

Anorm = (A - min2(A))/(max2(A) - min2(A));

Answer by Jing
on 30 Jan 2013

You can use 'normc' or 'normr' for normalization. 'c' or 'r' stands for columns or rows that you want to normalize.

Answer by Matt J
on 30 Jan 2013

You need to decide how you want to define the amplitude of the matrix first. Maybe you want this

normalized = A/norm(A);

or maybe this

normalized = A/max(abs(A(:)))

## 0 Comments