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: Making a square matrix from two vector
Replies: 22   Last Post: Mar 19, 2013 12:37 AM

Advanced Search

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

Posts: 214
Registered: 3/13/10
Re: Making a square matrix from two vector
Posted: Feb 8, 2013 5:40 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

% Data
a = [1 2 3 4];
b = [1 2 4 5].';

% Engine
X = (b * a) + bsxfun(@plus, a, b);

% And if you insist?
X(1, :) = a;
X(:, 1) = b;



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.