help-octave
[Top][All Lists]
Advanced

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

how to convert "list" to string


From: Karim Elaagouby
Subject: how to convert "list" to string
Date: Thu, 11 Feb 1999 19:03:33 -0800

Hi,

I am using version 2.1.13
argv is passed as a list. How do I convert its elements into strings ?

============================================================
this is the example given in the doc:

#! /bin/octave -qf
printf ("%s", program_name);
for i = 1:nargin
  printf (" %s", argv(i,:));
endfor
printf ("\n");

=========================

I put it in a file called testargv.m which I call as :

testargv.m hello octave users

this is what I get:

error: lists may only be indexed by a single scalar
error: evaluating argument list element number 2
error: evaluating index expression near line 4, column 3
error: evaluating for command near line 3, column 1

==========================

if I change argv(i,:) to argv(i)
I get this:

error: octave_base_value::matrix_value(): wrong type argument `list'
error: evaluating assignment expression near line 33, column 12
error: evaluating if command near line 32, column 3
error: called from `printf' in file
`/usr/local/share/octave/2.1.12/m/io/printf.m'



Thanks,

-
Karim Elaagouby
Information Systems Analyst
idealab!
130 W. Union St.
Pasadena, CA 91103
address@hidden
626/535-2779 Direct
626/585-6900 Reception
626/535-2701 fax





reply via email to

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