Dear All,
I need to compare 1 by 1 matrix and an integer value.
com te = 10
com bandw0 = 2.6614*((a2*te).^0.2); *This bandw is defined as RECTANGULAR[REAL], but the dimension is 1 by 1.
if bandw0 .ge. te-2
com bandw = te-2
else com bandw = bandw0
The second line of this program gives me an error message of:
## SX27. Illegal Combination of Data Types for Operation
It seems not allowed to compare an integer and a matrix.
What do I need to do?
Thank you for your help.
Aaron
Comparing matrix and integer
Re: Comparing matrix and integer
Is this always going to be a 1 x 1 "matrix"? If it is, why would you be doing it that way? Is A2 a VECTOR or a scalar? If it's a scalar, then you're making a mistake by using .^ instead of just ^ as that forces the result to be a 1 x 1 matrix when it's actually a scalar.
It looks like what you really want is
compute te=10
compute bandw=%min(2.6614*((a2*te)^0.2),te-2)
It looks like what you really want is
compute te=10
compute bandw=%min(2.6614*((a2*te)^0.2),te-2)
Re: Comparing matrix and integer
Dear Tom,
Many thanks for your help. I resolved the issue in the following way:
com hhh = %scalar(2.6614*((a2*te).^0.2));dis hhh
com bandw = %min(hhh,te-2); dis bandw
sincerely,
Aaron
Many thanks for your help. I resolved the issue in the following way:
com hhh = %scalar(2.6614*((a2*te).^0.2));dis hhh
com bandw = %min(hhh,te-2); dis bandw
sincerely,
Aaron