[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: decoding error message
From: |
asha g |
Subject: |
Re: decoding error message |
Date: |
Fri, 30 Nov 2007 00:47:14 -0800 (PST) |
Thanks James.That got sorted out. But I still don't
understand why that happened in the first place.
Asha
--- "James Sherman Jr." <address@hidden> wrote:
> I don't have octave currently available to confirm,
> but it looks like
> P is a cell array and not a matrix, so when you try
> to index by P(iii)
> is what gives you the error. Changing P to a
> matrix, such as using
> cell2mat, or just using the first element of P, such
> as just saying P
> = P{1}, I think should do the trick.
>
> James
>
> On Nov 30, 2007 1:42 AM, asha g <address@hidden>
> wrote:
> >
> > P = {
> > [1,1] =
> >
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.3280
> > 6.3280
> > 6.3280
> > 6.3280
> > 6.3280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> > 6.2280
> >
> > }
> > V =
> >
> > -70 -70 -70 -70 -70 -70 -70 -70 -70 -70
> > -70 -70 -70 -70 -70 -70 -70 -70 -70 -70
> >
> > deltat = 6.3823e-05
> >
> > S is what I am calculating
> >
> > Thanks
> > AG
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --- "John W. Eaton" <address@hidden> wrote:
> >
> > > On 29-Nov-2007, asha g wrote:
> > >
> > > |
> > > | Please help with the following section of code
> in
> > > a
> > > | larger function file :
> > > |
> > > | for iii = 2:(N-1)
> > > | S(iii) = V1(iii) + (deltat*(P(iii)));
> > > | end
> > > |
> > > | I get the following error message :
> > > |
> > > | error: invalid vector index = 2
> > > | error: evaluating argument list element number
> 1
> > > | error: evaluating for command near line 46,
> column
> > > 1
> > > | error: called from `timedepaxoct' in file
> > > |
> `/home/ashag/work/ashag/aseasha/timedepaxoct.m'
> > > | error: evaluating for command near line 61,
> column
> > > 1
> > > | error: near line 89 of file
> > > | `/home/ashag/work/ashag/aseasha/axactoct.m
> > > |
> > > | If I write for iii = 1: N-1
> > > |
> > > | I get :
> > > |
> > > | error: binary operator `*' not implemented for
> > > | `scalar' by `cell' operations
> > > | error: evaluating binary operator `*' near
> line
> > > 47,
> > > | column 25
> > > | error: evaluating binary operator `+' near
> line
> > > 47,
> > > | column 17
> > > | error: evaluating assignment expression near
> line
> > > 47,
> > > | column 8
> > > | error: evaluating for command near line 46,
> column
> > > 1
> > > | error: called from `timedepaxoct' in file
> > > |
> `/home/ashag/work/ashag/aseasha/timedepaxoct.m'
> > > | error: evaluating for command near line 61,
> column
> > > 1
> > > | error: near line 89 of file
> > > | `/home/ashag/work/ashag/aseasha/axactoct.m'
> > >
> > > I don't think anyone can say for sure what is
> > > happening without
> > > knowing what values are stored in your S, V1,
> deltat
> > > and P variables.
> > >
> > > jwe
> > >
> >
> >
> >
> >
> >
> >
> > Goals too clearly defined can become blinkers.
> > Mary Catherine Bateson
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Never miss a thing. Make Yahoo your home page.
> > http://www.yahoo.com/r/hs
> > _______________________________________________
> >
> > Help-octave mailing list
> > address@hidden
> >
>
https://www.cae.wisc.edu/mailman/listinfo/help-octave
> >
>
Goals too clearly defined can become blinkers.
Mary Catherine Bateson
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs