[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: newbie: avoiding loops & flushing output.
From: |
Mirek Kwasniak |
Subject: |
Re: newbie: avoiding loops & flushing output. |
Date: |
Sun, 14 Jul 2002 13:05:02 +0200 |
User-agent: |
Mutt/1.3.28i |
On Sun, Jul 14, 2002 at 01:20:03PM +0300, Yoel Callev wrote:
> 1) When I have a 'weight' scalar product of two vectors, i.e.
> sum_i(x(i)*y(i)*w(i)), is it possible to avoid a loop by phrasing it in
> a vector form, so that it'll run faster?
Use
sum(x.*y.*w)
or if you want a subset of vectors
sum(x(i).*y(i).*w(i))
> 2) When I run long scripts, I get all the output at the end, and thus
> have no progress indicator, is there a way to get some intermidiate
> output before the script is over without pausing the execution of the
> script?
See help for page_screen_output and page_output_immediately.
Mirek
-------------------------------------------------------------
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
-------------------------------------------------------------