Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to write the Gauss Function VECH in Matlab?

Subject: How to write the Gauss Function VECH in Matlab?

From: Patrick

Date: 17 Aug, 2012 07:08:17

Message: 1 of 3

The VECH function in Gauss vectorizes a symmetric matrix by retaining only the lower triangular portion of the matrix. It does in row-wise order.
Example:
x = [11 12 13
       21 22 23
       31 32 33]
therefore,
vech(x) =
[11; 21; 22; 31; 32; 33]

How can I do it in Matlab?

Thanks!

Subject: How to write the Gauss Function VECH in Matlab?

From: Bruno Luong

Date: 17 Aug, 2012 07:33:17

Message: 2 of 3

"Patrick" wrote in message <k0kql1$ajs$1@newscl01ah.mathworks.com>...
> The VECH function in Gauss vectorizes a symmetric matrix by retaining only the lower triangular portion of the matrix. It does in row-wise order.
> Example:
> x = [11 12 13
> 21 22 23
> 31 32 33]
> therefore,
> vech(x) =
> [11; 21; 22; 31; 32; 33]
>

y = x';
vech = y(triu(true(size(y))))

% Bruno

Subject: How to write the Gauss Function VECH in Matlab?

From: Patrick

Date: 18 Aug, 2012 05:20:21

Message: 3 of 3

Thanks, man! you are good. That works perfectly.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us