Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Recursive anonymous function
Date: Mon, 9 Mar 2009 08:49:01 +0000 (UTC)
Organization: University of Sydney
Lines: 16
Message-ID: <gp2l5t$7p4$1@fred.mathworks.com>
References: <gp22jh$sif$1@fred.mathworks.com> <gp2in5$pro$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 1236588541 7972 172.30.248.38 (9 Mar 2009 08:49:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Mar 2009 08:49:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1308310
Xref: news.mathworks.com comp.soft-sys.matlab:523421


Bruno

I encourage you to read the entire post.
The recursion does work when declared inside an m-file
(My query is about scope and declaration)

As for the iff function, I agree that branching and logical short cuts will not happen; but excluding that, it functions as a decision statement

eg:
iff(10>5,7,8) => 7
iff(10<5,7,8) => 8
char(iff(strmatch('max','maximum'),'inside','not in')) =>'inside'

as can be seen with the last example, the iff function is not perfect but for the example recursion i am using it is fine

Brandon