Thread Subject: help with blkdiag()

Subject: help with blkdiag()

From: Tim Yang

Date: 12 Jun, 2009 21:52:01

Message: 1 of 1

I have a 2D matrix

  1 2 3 4 5
  6 7 8 9 10
 11 12 13 14 15
 16 17 18 19 20

I want to create a diagonal matrix without using loops and using blkdiag()
ie matrix
  1 2 3 4 5 alll zero
  0 0 0 0 0 6 7 8 9 10
  0 0 0 0 0 0 0 0 0 0 11 12 13 14 15
  0 0 0 ... 16 17 18 19 20

I don't want to convert it to cell array (because the matrix is large, conversion is time consuming). blkdiag() only accept ( row vector, row vector...)

Thanks
Tim

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
construct block... Diego Lass 12 Jun, 2009 17:54:02
rssFeed for this Thread

Contact us at files@mathworks.com