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:
remove diagonal and reform matrix

Subject: remove diagonal and reform matrix

From: aiden

Date: 12 Oct, 2010 18:39:06

Message: 1 of 2

hi guys,

Given a matrix that is always nxn , so for example as follows a 3x3 :

K =

        -834 -269 -542
        -140 174 452
       -3178 -633 -1094


how can I remove the diagonal of this matrix and reform it as follows? :

new_K = [ -140
                -3178
                 -269
                 -633
                 -542
                  452 ]

all the best,
aiden

Subject: remove diagonal and reform matrix

From: Matt J

Date: 12 Oct, 2010 18:50:05

Message: 2 of 2



new_K=K(~eye(size(K))),

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