The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: index end-point to matrix
Replies: 6   Last Post: Feb 4, 2013 11:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 7
Registered: 12/7/04
index end-point to matrix
Posted: Jan 30, 2013 4:38 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a vector with indices, for e.g.

b = [1 4 7]

Using these indices, I am trying to develop a matrix that looks like this
a =[1 0 0;
2 3 4;
5 6 7]

In other words, the indices variable (b) indicates end-points of the matrix a for each row. This looks simple but been trying to figure out how to generalize the code when b could be of different sizes. Any hints would be appreciated.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.