From help-octave-request at bevo dot che dot wisc dot edu Fri Jan 30 07:03:16 2004 Subject: Problem in a if condition From: Pol To: help-octave at bevo dot che dot wisc dot edu Date: Fri, 30 Jan 2004 13:58:30 +0100 Hi there, this is my forst message on the list, I say hello to everyone. I subscribed because I don't find any solution to my problem on the net. Let's explain it. I'm a student trying to convert teachers of my school to use octave instead of another well know math soft. I succeded to find how to use .m files and I have a problem with that one: function [ZE,ZM,ZS] = cqy2pip(y) % fonction [YE,YM,YS] = cqy2pip(y) y11=y(1,1); y12=y(1,2); y21=y(2,1); y22=y(2,2); if ( (y12-y21) > 0.00000001 ) error ("The quadripole is not passif"); else ZE = 1 / (y11+y21) ; ZM = -1 / y21 ; ZS = 1 / (y22+y21) ; endif endfunction And this is the output I get: octave:1> t=[1,6;3,4] t = 1 6 3 4 octave:2> z=cqy2pip(t) error: The quadripole is not passif error: evaluating if command near line 10, column 3 error: called from `cqy2pip' in file `/usr/share/octave/2.1.50/m/CQFILES/cqy2pip.m' error: evaluating assignment expression near line 2, column 2 octave:2> So... where is the error ? Thanks for your time. -pol- ------------------------------------------------------------- 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 -------------------------------------------------------------