MATLAB Answers

1

how to span a 3*1 vector into a 3*3 skew symmetric matrix ?

Asked by Stanley Cheng on 18 Jun 2014
Latest activity Edited by Wit
on 15 Sep 2019
Hi everyone, as the title,
x=[a b c]' is a 3*1 vector, and its 3*3 skew symmetric matrix is
X=[0 -c b ;
c 0 -a ;
-b a 0 ];
what command is all right to make it in Matlab ?
THX very much!
Cheers

  0 Comments

Sign in to comment.

3 Answers

Answer by Sean de Wolski
on 18 Jun 2014
 Accepted Answer

X=[0 -x(3) x(2) ; x(3) 0 -x(1) ; -x(2) x(1) 0 ];

  3 Comments

Hi Sean,
yeah you are right, but I mean if some command available directly to make it ? So we do not need to write so much, for I have several vectors to span into skew symmetric matrices.
Take Sean's code and make a function out of it.
A great virtue of MATLAB (ok, almost any programming language) is the ability to write functions that do what you want. Making a skew-symmetric matrix from a vector is not something most people will ever need to do, so it is unlikely you would find a simple command to do it. However, since you can write functions that do anything you want, anything that you will do often, then do so. Personalize your version of MATLAB to include such tools that do what you have a need for.
In this case, a simple m-file would suffice. Or write a function handle if this is not something you will have a need for beyond today.
Finally, the code that Sean gives is easily vectorized to create a 3-d array, where each plane would be one such matrix.

Sign in to comment.


Answer by Raul Cajias on 20 Apr 2016

I think what you're looking for is the skewdec skewed function. However it's only available with the 'Robust Control Toolbox'.

  0 Comments

Sign in to comment.


Answer by Wit
on 15 Sep 2019
Edited by Wit
on 15 Sep 2019

I think there is a "cross2Matrix" function:
x = [1; 2; 3];
cross2Matrix(x)
ans =
0 -3 2
3 0 -1
-2 1 0

  0 Comments

Sign in to comment.