From: "Abo Bshire" <moh054@yahoo.com>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webx
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to terminate a function?
Message-ID: <ef1b760.3@webx.raydaftYaTP>
Date: Wed, 16 Nov 2005 11:33:13 -0500
References: <ef1b760.-1@webx.raydaftYaTP> <4379e5b5$0$67261$157c6196@dreader2.cybercity.dk> <ef1b760.1@webx.raydaftYaTP> <ef1b760.2@webx.raydaftYaTP>
Lines: 29
NNTP-Posting-Host: 24.210.235.141
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:313960


Jérôme wrote:
>
>
> Abo Bshire wrote:
>>
>> function a=myfun(b)
>> for i=1:b
>> i=i+1;
>> if i=3
>> a=i;
>> return
>> end
>> a=i;
>> end;
>>
>
> Hi,
>
> The above code is wrong !
> Are you new to Matlab ?
> Is it just an example ?
>
> Jérôme
Yes absolutley it was wrong ... specifically,
 'if i=3' should be 'if i==3'
it was just an example ...

Thanks,
Abo Bshire