Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: One or more output arguments not assigned during call
Date: Fri, 16 Aug 2013 21:25:08 +0000 (UTC)
Organization: Mitre Corp
Lines: 54
Message-ID: <kum5bk$l17$1@newscl01ah.mathworks.com>
References: <ku883j$n4p$1@newscl01ah.mathworks.com> <kudtbu$fr3$1@newscl01ah.mathworks.com> <kult37$epu$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1376688308 21543 172.30.248.45 (16 Aug 2013 21:25:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 Aug 2013 21:25:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2318
Xref: news.mathworks.com comp.soft-sys.matlab:801042

"Sanaa" wrote in message <kult37$epu$1@newscl01ah.mathworks.com>...
> Thanks a lot for your explanation. I have corrected many parts of my code and now I have 7 m files. so I am not sending them all. Howerver, running my code :
> function output=bifurcation(parameters, orders, trans,tend,tstep, Y0,range);
> 
> D=[];  % data (bifurcation diagram)
> 
> q1=orders(1); q2=orders(2); q3=orders(3);
> 
> mu=parameters(1);
> lambda=parameters(2); b=parameters(3); gama=parameters(4); omega=parameters(5);
> for mu=range(1):range(2):range(3)
> 
>     fprintf('mu=%g...\n',mu);
> 
>     [t,x] = run(parameters, orders, trans,tend,tstep,Y0,mu);
>     
>     for i=2:length(x(:,2))-1
>         if((x(i,2)>x(i-1,2))&&(x(i,2)>x(i+1,2)))
>             D=[D; mu x(i,2)];
>         end
>     end
>     
> end
> 
> figure(3)
> plot(D(:,1),D(:,2),'b.','MarkerSize',1.5)
> 
> xlabel('\mu','fontsize',18);
> ylabel('max(X)','fontsize',18);
> 
> with 
> output=bifurcation([ 0.9 -1 1 0.6 1],[0.85 0.15 1], 100,500,0.05, [0 0 0],[0 0.05 3]);
> gives the error
> ??? Attempted to access orders(1); index out of bounds because numel(orders)=0.
> 
> Error in ==> FODuffing at 6
> q1=orders(1); q2=orders(2); q3=orders(3);
> 
> Error in ==> run at 14
>     [T, Y]=FODuffing(@dxdt,ttrans,Y0,option,mu)
> 
> Error in ==> bifurcation at 19
>     [t,x] = run(parameters, orders, trans,tend,tstep,Y0,mu);
> 
> 
> Why this error? I have defined the 3 orders in all files!!!!
> Thanks a lot for your help.

It looks like the error message is complaining on how you call FODuffing 
(at line 6), not on how you are calling bifurcation.

If FoDuffing is defined as:
[T, Y]=FODuffing(@dxdt,ttrans,Y0,option,mu)
then how are you passing orders to it?