[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Help eliminating intermediate results

**From**: |
Matt Matthews |

**Subject**: |
Re: Help eliminating intermediate results |

**Date**: |
17 Jul 2003 23:22:19 -0400 |

On Thu, 2003-07-17 at 23:09, Fausto Arinos de A. Barbuto wrote:
>* My question then is: how do I get rid of the undesired intermediate*
>* results of the form "y = ...."? I tried "echo off" and "echo off all" --*
>* to no avail.*
You may use the semicolon (;) to suppress output in functions, and in
general on any statement. For example:
function y = f(x)
y = (2.0/sqrt(pi))*exp(-x*x); % NOTE
endfunction
Then for defining x again use semicolon:
x = linspace(0,0.01,200);
But not here, so you can see the final result:
quad ("f", 0, 2.5, 1.0e-6)
As typed above, the commands should only output the final number
(0.99959).
Hope that helps.
matt
-------------------------------------------------------------
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
-------------------------------------------------------------