Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Naresh
Posts:
7
Registered:
12/7/04


index endpoint to matrix
Posted:
Jan 30, 2013 4:38 PM


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 endpoints 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.
Thanks, Naresh



