eval and suppressed output

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

eval and suppressed output

David D. Clark
I have a matrix of data, (mxn)[], which I want to reference with a name
stored in a string, stringname="stringvalue", and store the value of the
matrix in a regular variable called data.

data=eval(stringname)

I want to suppress all output of this operation.  Putting a semicolon at
the end of the entire statement suppresses the output data=(mxn)[], but the
output stringvalue=(mxn)[] is not suppressed.  Putting a semicolon after
stringname results in a parse error.

octave> data=eval(stringname;);
parse error:

>>> data=eval(stringname;);
                        ^
Could somebody please point me in the right direction for suppressing all
output of this statement.

Thanks,

Dave

David D. Clark
Graduate Research Assistant, Biophysics Group, P-21
MS D454
Los Alamos National Laboratory
Los Alamos, NM 87545
Phone (505)667-4147 Fax (505)665-4507


Reply | Threaded
Open this post in threaded view
|

eval and suppressed output

John W. Eaton-6
On 18-Aug-1998, David D. Clark <[hidden email]> wrote:

| I have a matrix of data, (mxn)[], which I want to reference with a name
| stored in a string, stringname="stringvalue", and store the value of the
| matrix in a regular variable called data.
|
| data=eval(stringname)
|
| I want to suppress all output of this operation.  Putting a semicolon at
| the end of the entire statement suppresses the output data=(mxn)[], but the
| output stringvalue=(mxn)[] is not suppressed.  Putting a semicolon after
| stringname results in a parse error.
|
| octave> data=eval(stringname;);
| parse error:
|
| >>> data=eval(stringname;);
|                         ^
| Could somebody please point me in the right direction for suppressing all
| output of this statement.

Put a semicolon at the end of the string itself:

  data = eval ("x = 1;");

or set the built-in variable `default_eval_print_flag' to 0.

jwe