Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!nx01.iad01.newshosting.com!newshosting.com!130.81.64.211.MISMATCH!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny08.POSTED!702e7bde!not-for-mail
From: James Tursa <aclassyguywithaknotac@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: generate a positive semi-definite matrices??
Message-ID: <0rqsq3tqr22j3e1h3emodegqmra5bd76rt@4ax.com>
References: <b082bc0e-5d7a-4bcf-ab79-478ad6a820f9@e4g2000hsg.googlegroups.com>
X-Newsreader: Forte Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 26
Date: Sun, 10 Feb 2008 03:17:33 GMT
NNTP-Posting-Host: 71.112.97.190
X-Complaints-To: abuse@verizon.net
X-Trace: trndny08 1202613453 71.112.97.190 (Sat, 09 Feb 2008 22:17:33 EST)
NNTP-Posting-Date: Sat, 09 Feb 2008 22:17:33 EST
Xref: news.mathworks.com comp.soft-sys.matlab:450401


On Sat, 9 Feb 2008 18:50:10 -0800 (PST), VijaKhara
<VijaKhara@gmail.com> wrote:

>Hi all
>
>
>I need to generate a 3x3 positive semi-definite matrix but I don't
>know what MATLAB function can do this?
>Or is there any method to generate without try & check method?
>
>Also, do you know what MATLAB function can be used to check if a
>matrix is a positive semi-definite matrix?
>
>Thank you

One way to generate a random positive semi-definite 3x3 matrix:

a = rand(3,3)
ata = a'*a

To check, use the eig function to see that all of the eigenvalues are
non-negative

eig(ata)

James Tursa