From help-octave-request at bevo dot che dot wisc dot edu Sun Feb 1 08:12:05 2004 Subject: Small problem in a if condition From: Pol To: help-octave at bevo dot che dot wisc dot edu Date: Sun, 1 Feb 2004 15:09:14 +0100 --Signature=_Sun__1_Feb_2004_15_09_14_+0100_Fv2xJg3lUBcWumkE Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit Hi there, I'm trying to convert that script from matlab to octave and I'm hurting my head on that script: function zp = kzp(v,z,i) if (v == '?') d = z*i ; endif if (z == '?') d = v/i ; endif if (i == '?') d = v/z ; endif M = norm(d) ; P = angle(d)*180/pi ; zp=[M;P]; endfunction And now the errors: octave:1> kzp(1,'?',3) error: invalid conversion from string to real matrix error: type conversion failed for binary operator `==' error: evaluating binary operator `==' near line 7, column 7 error: if: error evaluating conditional expression error: evaluating if command near line 7, column 1 error: called from `kzp' in file `/home/pol/.octave/m/kzp.m' octave:1> Thx for the help, have a happy sunday all. -pol- --Signature=_Sun__1_Feb_2004_15_09_14_+0100_Fv2xJg3lUBcWumkE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAHQiQRF2AKNGgnwYRAtxvAJ0WVycZhiZ5MhXx6Ab2irRov9YXZACfci/B pdJkTQsh2TyojRe8Cl5xxPI= =F1ze -----END PGP SIGNATURE----- --Signature=_Sun__1_Feb_2004_15_09_14_+0100_Fv2xJg3lUBcWumkE-- ------------------------------------------------------------- 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 -------------------------------------------------------------