|
|
 | | From: | Carine Simon | | Subject: | convert matrix to vectors or vectors to matrix | | Date: | Sun, 23 Jan 2005 14:27:26 -0500 |
|
|
 | Hi, I wanted to know if there were built-in Matlab functions to do that?
Thanks a lot,
Carine
|
|
 | | From: | Dan Hensley | | Subject: | Re: convert matrix to vectors or vectors to matrix | | Date: | Sun, 23 Jan 2005 12:36:07 -0700 |
|
|
 | On Sun, 23 Jan 2005 14:27:26 -0500, Carine Simon wrote:
> Hi, > I wanted to know if there were built-in Matlab functions to do that? > > Thanks a lot, > > Carine
help reshape
Dan
|
|
 | | From: | Anders Björk | | Subject: | Re: convert matrix to vectors or vectors to matrix | | Date: | Sun, 23 Jan 2005 20:57:28 +0100 |
|
|
 | Yes it has
% Some examples Matrix=randn(10,15); Vector=Matrix(:); Vector=reshape(Matrix,10*15,1); or use Matrix=reshape(Vector,10,15);
To repate values use repmat
BR Anders "Carine Simon" skrev i meddelandet news:eef96aa.-1@webx.raydaftYaTP... > Hi, > I wanted to know if there were built-in Matlab functions to do that? > > Thanks a lot, > > Carine
|
|
 | | From: | Johan Carlson | | Subject: | Re: convert matrix to vectors or vectors to matrix | | Date: | Sun, 23 Jan 2005 20:41:10 +0100 |
|
|
 | Carine Simon wrote: > Hi, > I wanted to know if there were built-in Matlab functions to do that? > > Thanks a lot, > > Carine
To convert a matrix A to a vector, simply type A(:)
For more general conversion, check the reshape function
/Johan
|
|
|