[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Scripting question
From: |
John B. Thoo |
Subject: |
Scripting question |
Date: |
Thu, 25 Mar 2004 18:08:33 -0800 |
Hi. I'm sorry if this is a faq. I tried to RTFM, but to no avail.
I have an array of data in a file, beul.dat, that I would like to plot.
Typing the following, e.g.,
octave:54> plot (beul (1,:), beul (2,:))
octave:55> plot (beul (1,:), beul (3,:))
etc., works to give different plots. But each one's a lot to type.
So, I thought I would simplify life by writing a "for" loop:
octave:56> nframes = 10;
octave:57> x = beul (1,:);
octave:58> for i = 1:nframes
> plotframe (i) = eval (sprintf ("plot (x, %s);", beul (i+1,:)));
> endfor
in the hope that I could simply type "plotframe (1)", "plotframe (2)",
etc., to get the different plots. HOWEVER, I get the following errors:
error: octave_base_value::string_value(): wrong type argument `matrix'
error: evaluating argument list element number 1
error: evaluating assignment expression near line 59, column 15
error: evaluating for command near line 58, column 1
octave:58>
I only guessed at the syntax to use in the "for" loop based on the
recent threads on plotting, but, to be honest, I have absolutely no
idea what I'm doing. Any suggestions?
TIA.
---John.
-------------------------------------------------------------
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
-------------------------------------------------------------
- Scripting question,
John B. Thoo <=