Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: for loop - variable increment
Date: Wed, 11 Jun 2008 17:35:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <g2p2c7$mia$1@fred.mathworks.com>
References: <g2p1ca$8sa$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 1213205703 23114 172.30.248.37 (11 Jun 2008 17:35:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 11 Jun 2008 17:35:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1254920
Xref: news.mathworks.com comp.soft-sys.matlab:473331



"Mario " <nospam@yahoo.com> wrote in message <g2p1ca$8sa
$1@fred.mathworks.com>...
> Hi.
> I want to test an algorithm with different values for the input variables.
> 
> I thought to call my function inside a for loop but i want to increment the 
> input variable with a inconstant increment.
> 
> e.g.
> for i=0.0001:i:1
>    test(i)
> end
> 
> so the first call would be test(0.0001), the second one test(0.0002), the 
third 
> one test(0.0004), then test(0.0008) and so on.
> 
> I tried also the following way
> i=0.0001
> for j=0.0001:i:1
>    test(j)
>    i=j;       % or i=2*i;
> end

i has to be an integer.
Try:
for i =1:1000
     test(i*.0001)
end