help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Small problem in a if condition


From: Pol
Subject: Small problem in a if condition
Date: Sun, 1 Feb 2004 15:09:14 +0100

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-

Attachment: pgpQdQIqhzZjd.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]