help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The parse error on the "x"


From: Benjamin Abbott
Subject: Re: The parse error on the "x"
Date: Fri, 01 Feb 2013 15:36:48 -0500


On Feb 1, 2013, at 3:33 PM, Taban <address@hidden> wrote:

Hi everybody,
I am a newby at Octave, I am trying to solve a one order differential equation. Thats my code:
function y = f (x,t)
y = 5-2x;
endfunction
first = 2;
t - linspace(0,20,100)
s = lsode("f","first",t);
plot(t,s,"r-")

And this is my error:
parse error near line 2 of file .../dif.m
syntax error
>>> y = 5-2x;
                    ^

You neglected to multiply

y = 5 - 2 * x;

Ben

reply via email to

[Prev in Thread] Current Thread [Next in Thread]