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



how to create a matrix?
Posted:
Apr 16, 1997 1:46 PM


> > > > suppose I have a vector a=[2 3 4 3]. With the information in this vector > I'd like to build a matrix, M in the following way. > > The first row in M should consist of 2 ones. The second row of 3 ones, > the third row of 4 ones, the fourth row of 3 ones. It should look like > this. > > M= [1 1 0 0 > 1 1 1 0 > 1 1 1 1 > 1 1 1 0] > > The number of columns in M is thus determined by the maximum value in a. > The number of rows in M is determined by the number of elements in a. > > Any help would be appreciated.



