Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: dynamically creating for loops
Date: Wed, 9 Sep 2009 06:20:17 +0000 (UTC)
Organization: Indian Institute of Technology
Lines: 21
Message-ID: <h87hf1$q8e$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1252477217 26894 172.30.248.37 (9 Sep 2009 06:20:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Sep 2009 06:20:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 223861
Xref: news.mathworks.com comp.soft-sys.matlab:569157


Hi
I have a problem in creating for loops
Suppose there is a variable n.(say 10)

for i1 = 1:10
    for i2 = i1-1:i1+1
         for i3 = i2-1:i2+1
          .....
               for i'n'( i.e i10 in present case) = i9-1:i9+1
                statements

           end
         end
     end..
end

How can I fix this for loops varyingly ?
Is it possible at all ?

with regards,
ramana