Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: for loop - variable increment
Date: Wed, 11 Jun 2008 17:55:55 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 29
Message-ID: <g2p3jb$7bd$1@canopus.cc.umanitoba.ca>
References: <g2p1ca$8sa$1@fred.mathworks.com> <g2p2c7$mia$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1213206955 7533 192.70.172.160 (11 Jun 2008 17:55:55 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Wed, 11 Jun 2008 17:55:55 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:473339



In article <g2p2c7$mia$1@fred.mathworks.com>,
Sean  <sean.dewolski@Idontwantspam.umit.maine.edu> wrote:
>"Mario " <nospam@yahoo.com> wrote in message <g2p1ca$8sa
>$1@fred.mathworks.com>...

>> for i=0.0001:i:1
>>    test(i)
>> end

>> i=0.0001
>> for j=0.0001:i:1
>>    test(j)
>>    i=j;       % or i=2*i;
>> end

>i has to be an integer.

Where did you get that idea??

doc for

  for x=initval:stepval:endval, statements, end is the same as the
  above syntax, except that loop counter x is incremented (or
  decremented when stepval is negative) by the value stepval on each
  iteration through the loop. The value stepval must be a real number
  or can also be a call to a function that returns a real number.
-- 
  "Do not on any account attempt to write on both sides of
  the paper at once."                         -- Walter C. Sellar