help-octave
[Top][All Lists]
Advanced

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

Re: unassigned variables


From: Ivan Sutoris
Subject: Re: unassigned variables
Date: Wed, 25 Mar 2009 23:11:53 +0100

2009/3/25 Jim Maas <address@hidden>:
> Hi All, thanks for help thus far. I might be asking too much, am trying
> iteratively to build up a model one step at a time, and usually when error
> messages start, they are not related to what I just added! :-D
>
> I get the following error,
>
> error: `qpa' undefined near line 28 column 29
> error: evaluating argument list element number 2
> error: evaluating binary operator `-' near line 28, column 46
> error: called from `?unknown?'
> error: evaluating assignment expression near line 328, column 17
> error: evaluating if command near line 317, column 7
> error: evaluating for command near line 314, column 5
> error: evaluating while command near line 303, column 3
> error: called from `ode45' in file
> `/usr/share/octave/packages/3.0/odepkg-0.6.4/ode45.m'
> error: near line 45 of file `/home/jamaas/Resarch/Octave/M-M Stuff/jim.m'
>
>
> when the last line
>
> [t, qpb] = ode45 (dqpbdt, [0:0.1:10], qb0); %Octave
>
> is added to the script.
>
> Where have I gone wrong or is this perhaps a bug, using 3.0.4-rc5
>
> Just for imformation, where do line numbers like 317 come from ?
>
>
> Thanks
>
> Jim
> ----
> Jim Maas

Line 45 of your code calls ode45, ode45 then calls (at line 328)
anonymous function dqpbdt defined at line 28 of your script. Problem
is that when you defined dqpbdt at line 28, variable qpa was not yet
defined, hence the error. You should move definition of dqpbdt to a
place where qpa is already defined (that is after the first ode45
call)

Regards
Ivan Sutoris


reply via email to

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