help-octave
[Top][All Lists]
Advanced

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

error: value on right hand side of assignment is undefined


From: Williams, Timothy J Mr CECOM RDEC NVESD
Subject: error: value on right hand side of assignment is undefined
Date: Fri, 26 Apr 2002 09:53:50 -0500

I just installed Octave 2.0.17 on a Redhat 7.2 machine and am trying to run
some MatLab code. I am trying to assing the output of a 'dir' command to a
variable and I get the message

error: value on right hand side of assignment is undefined 

For example, I have a variable for the current directory 'thisdir'
(/home/williams/octave-2.0.17/doc/interpreter)

octave:3> thisdir=strcat(pwd,'/')
thisdir = /home/williams/Linux/octave-2.0.17/doc/interpreter/

Then I need a row vector of filenames following a pattern. e.g.
'dir(octave_?.html)'

octave:4> dir([thisdir,'octave_?.html'])
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_1.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_2.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_3.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_4.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_5.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_6.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_7.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_8.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_9.html

I want to assign this to a variable, but I get:

octave:5> list=dir([thisdir,'octave_?.html'])
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_1.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_2.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_3.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_4.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_5.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_6.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_7.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_8.html
/home/williams/Linux/octave-2.0.17/doc/interpreter/octave_9.html
error: value on right hand side of assignment is undefined
error: evaluating assignment expression near line 5, column 5

I tried using changing dir() to glob(), but I got a 2d array of chars
instead of a row vector of strings. I'm a newbie at this. If there is a way
to convert a row of chars to a string, that would be satisfactory.

Thanks for any help.

----
Tim Williams                                                 COM: (703)
704-1685
Night Vision & Electronic Sensors Directorate  DSN: 654-1685
10221 Burbeck Road, Suite 430                      FAX: (703) 704-1753
Ft. Belvoir, VA 22060-5806                             EMAIL:
address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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