Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: diagonally dominant matrix
Date: Thu, 30 Apr 2009 13:45:03 +0000 (UTC)
Organization: Hochschule Wismar
Lines: 16
Message-ID: <gtca0v$7nb$1@fred.mathworks.com>
References: <gt79qm$ptn$1@fred.mathworks.com> <gtc319$m35$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1241099103 7915 172.30.248.38 (30 Apr 2009 13:45:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 30 Apr 2009 13:45:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1170607
Xref: news.mathworks.com comp.soft-sys.matlab:536458


Does this serve?

z=round(1000*randn(5,5))
z2=z+diag(sum(abs(z),2))

, but I guess you would have learnt more by doing it yourself.

Regards,
Stefan

"dew dropz" <dewdropz89@msn.com> wrote in message <gtc319$m35$1@fred.mathworks.com>...
> "dew dropz" <dewdropz89@msn.com> wrote in message <gt79qm$ptn$1@fred.mathworks.com>...
> > hi, i am new to matlab n i need a code to create a random diagonally dominant matrix
> thx, buy the eye(n) is just an identity matrix, and rand gives decimals.
>  i meant a random matrix with integers but has to be diagonally dominant