From: "Steven_Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Adams-Bashforth-Moulton method
Date: Tue, 5 Feb 2013 13:12:32 -0500
Organization: MathWorks
Lines: 45
Message-ID: <keri2h$bj1$>
References: <>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 8bit
X-Trace: 1360087953 11873 (5 Feb 2013 18:12:33 GMT)
NNTP-Posting-Date: Tue, 5 Feb 2013 18:12:33 +0000 (UTC)
In-Reply-To: <>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:788295

"Emilia Przybysz" <> wrote in message
> Hi, I have a huge problem. I have to write a script that solve 
> differential equation like this
> 2000y"=98(1+y')^2{t(t-1)+2}
> using Adams-Bashforth-Moulton method and then compare results using ode45. 
> I wrote a function
>>function dy = belka(t,y)
>>% funkcja w ktrej zapisali?my rwnanie rniczkowe
>>dy=zeros(2,1) ;

The section:


creates a cell array. MATLAB doesn't know how to multiply the previous term 
in the definition for dy(2):


and a cell array -- it's not defined. Use parentheses instead of curly 
braces if all you want to do is group together the expression representing 
"t times t-1, plus 2", just like you used parentheses to group the 
expression "9.8 times 10 divided by 2000."


>>[t, y]=rk4(f, tspan0, y0, 3, varargin{:});

Here and in the similar function evaluation calls later in your code curly 
braces ARE needed, as you're working with the cell array VARARGIN.


Steve Lord
To contact Technical Support use the Contact Us link on