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.

(no subject)

Date: 2008-08-12 04:07 am (UTC)
ikeepaleopard: (Default)
From: [personal profile] ikeepaleopard
I am pretty sure 1.0 does not have an infinite binary expansion. Floats are generally precise for small integers. however 0.1 does have an infinite expansion.

(no subject)

Date: 2008-08-12 12:46 pm (UTC)
From: [identity profile] en-ki.livejournal.com
Yep, I spaced that. 1.0 != 0.1e1.

February 2020

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

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags