gusl: (Default)
[personal profile] gusl


Octave 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.
(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

February 2020

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags