```Path: news.mathworks.com!not-for-mail
From: "Steven_Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Date: Tue, 5 Feb 2013 13:12:32 -0500
Organization: MathWorks
Lines: 45
Message-ID: <keri2h\$bj1\$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: ah-slord.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="UTF-8";
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1360087953 11873 172.28.9.169 (5 Feb 2013 18:12:33 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 5 Feb 2013 18:12:33 +0000 (UTC)
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: news.mathworks.com comp.soft-sys.matlab:788295

"Emilia Przybysz" <emilia.przybysz0909@gmail.com> 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) ;
>>dy(1)=y(2);
>>dy(2)=(9.8*10/2000)*(1+y(2))^2*{t.*(t-1)+2};

The section:

{t.*(t-1)+2}

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

(9.8*10/2000)*(1+y(2))^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."

*snip*

>>[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.

*snip*

--
Steve Lord
slord@mathworks.com