Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: how to create a matrix?
Replies: 5   Last Post: Apr 17, 1997 2:59 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
bahram.sarban@apfund1-3.se

Posts: 2
Registered: 12/11/04
how to create a matrix?
Posted: Apr 16, 1997 1:46 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> > >
> 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.






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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.