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

Thread Subject:
Replacing section in a matrix

Subject: Replacing section in a matrix

From: Ben Clark

Date: 31 May, 2011 20:42:20

Message: 1 of 2

So I have a matrix that is 180x360 and I need a specific block that is 28x64 replaced. Just for example purposes lets say that i need my 28x64 matrix to start with its top left most cell being at cell 100;100 how would I go about automating this replacing process?

Subject: Replacing section in a matrix

From: Darren Rowland

Date: 1 Jun, 2011 01:45:19

Message: 2 of 2

Here is the basic idea

A = zeros(180,360);
A(100:127,100:163) = 1; % index into the matrix
imagesc(A)

You can also do the following
m = 100:127;
n = 200:263;
A(m,n) = 0.5;
imagesc(A)

Hth
Darren

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