Octave is acting insane
Aug. 11th, 2008 07:26 pmOctave seems to think that the first entry in b isn't 1. But if you ask it what it is, it says 1. I've even tried 1 to different precisions, and it never says yes.
The code is:
function ret = stationaryDistr(mat)
[a,b] = eig(mat')
val = [0,0,0,0];
b(1,1)==1.0000
b(1,1)
if (b(1,1)==1)
val = normalize(a(:,1));
elseif (b(2,2)==1)
val = normalize(a(:,2));
end
ret = val
endfunction
I've had this issue since last week.
UPDATE: problem solved! See the comments below.
---
Generally, it seems easy to abuse. The error messages.
Now, I just wish I could the enforce number / types of arguments passed to functions... or at least get a warning when the wrong number/type is passed.
(no subject)
Date: 2008-08-12 04:07 am (UTC)(no subject)
Date: 2008-08-12 12:46 pm (UTC)