[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
comparing the magnitude order
From: |
CdeMills |
Subject: |
comparing the magnitude order |
Date: |
Fri, 9 Sep 2011 02:24:51 -0700 (PDT) |
Hello,
I would like to compare if two numbers are of the same order of magnitude. I
implement this as
magn =@(x, y) max (x, y)/min (x, y);
But there are redundancies: if x is > y, then the expression becomes x/y,
else y/x. Is it possible to introduce tests inside function handle ?
magn=@(x, y) if (x > y) x/y else y/x endif
is accepted but doesn't return anything.
Regards
Pascal
--
View this message in context:
http://octave.1599824.n4.nabble.com/comparing-the-magnitude-order-tp3801176p3801176.html
Sent from the Octave - General mailing list archive at Nabble.com.
- comparing the magnitude order,
CdeMills <=