From help-request at octave dot org Sun Jan 23 19:46:34 2005 Subject: Evaluating quadratic functions From: hanrahat at comcast dot net To: help at octave dot org Date: Mon, 24 Jan 2005 01:50:38 +0000 I'm having trouble understanding how to evaluate and plot quadratic functions. Here's a sequence that explains what I'm trying to accomplish. In particular, I don't understand the error message "error: for A^b, A must be square" It doesn't seem that A being square has anything to do with the function. Can anyone help me understand how to do this? Thanks, -- Tom GNU Octave, version 2.1.50 (i686-pc-linux-gnu). Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 John W. Eaton. This is free software; see the source code for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. Please contribute if you find this software useful. For more information, visit http://www.octave.org/help-wanted.html Report bugs to . octave:1> x = 1:1:2; octave:2> sqrt(x) ans = 1.0000 1.4142 octave:3> exp(x) ans = 2.7183 7.3891 octave:4> function retval = linear(x) > retval = x + 1; > endfunction octave:5> linear(x) ans = 2 3 octave:6> function retval = quad(x) > retval = x^2; > endfunction octave:7> quad(x) error: for A^b, A must be square error: evaluating binary operator `^' near line 2, column 11 error: evaluating assignment expression near line 2, column 8 error: called from `quad' octave:7> ------------------------------------------------------------- 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 -------------------------------------------------------------