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: convert a matrix to vector
Replies: 5   Last Post: Dec 13, 2012 6:22 PM

Advanced Search

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

Posts: 32
Registered: 12/11/12
Re: convert a matrix to vector
Posted: Dec 13, 2012 3:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


> "yafit maymon" wrote in message <i9rjub$jmg$1@fred.mathworks.com>...
>> hello!!! i need to convert a matrix in to a vector , i have tried to
>> use the reshape function but it does not convert the way i want , i
>> need, for example : the matrix:
>> 2 3 4 5
>> 6 7
>>
>>
>> and i need it to convert to a vector like this: [2 3 4 5 6 7 ]
>>
>> thank you ifor your help ....



A = [2 3; 4 5; 6 7];
v = reshape( A.' ,1,numel(A));
disp(v)

bartekltg




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.