Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
matlab change array range

Subject: matlab change array range

From: Aron Sceidt

Date: 26 May, 2012 10:06:40

Message: 1 of 3

I have an matlab array A = [ 20 25; 40; 95]. I need to change the elements of the array such that the smallest becomes 1 and the largest becomes 256 and the rest of the values take a value according to the range.

In reality the array A will be much larger than 2 by 2. Does matlab have something built in that can do this?

Subject: matlab change array range

From: Bruno Luong

Date: 26 May, 2012 10:58:32

Message: 2 of 3

1 + (A-min(A(:)))*(255 / (max(A(:))-min(A(:))))

Subject: matlab change array range

From: ImageAnalyst

Date: 26 May, 2012 15:53:09

Message: 3 of 3

On May 26, 6:06

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us