Path: news.mathworks.com!newsfeed-00.mathworks.com!fu-berlin.de!feeder.erje.net!eu.feeder.erje.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Verify if a matrix is upper triangular. Also if it is lower triangular
Date: Sat, 24 Nov 2012 14:21:02 -0600
Organization: Aioe.org NNTP Server
Lines: 18
Message-ID: <k8ra94$9m0$1@speranza.aioe.org>
References: <k8r8qj$ljq$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: siVB/j7OreVJTnn+/1o/tQ.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:783411

On 11/24/2012 1:57 PM, Edwardo wrote:
> Hi!
>
> I am a new Matlab user, and I want to test if a matrix is upper or lower
> triangular. Something like : isupper(mat) and islower(mat)
> Can someone tell me if there exits functions already fot this?
> If not, can someone help me to build functions for this?
>
> Thanks!

Simple enough...

r = function istriu(z)
   r=all(all(z==triu(z)));

extension should be obvious... :)

--