octave:2> A=rand(4) A = 0.955779 0.754873 0.337433 0.117565 0.739101 0.507642 0.715108 0.768464 0.383396 0.319969 0.028246 0.791455 0.991989 0.276351 0.910944 0.973451 octave:3> b=rand(1,4) b = 0.64702 0.17631 0.65138 0.30402 octave:4> x=b/A x = 0.172178 0.033254 -0.460236 0.639453 octave:5> x*A ans = 0.64702 0.17631 0.65138 0.30402 octave:6> b b = 0.64702 0.17631 0.65138 0.30402 octave:7> A/b ans = 1.04200 1.31114 0.58306 1.63473 octave:8> help mrdivide 'mrdivide' is a built-in function from the file libinterp/corefcn/data.cc -- Built-in Function: mrdivide (X, Y) Return the matrix right division of X and Y. This function and x / y are equivalent. See also: mldivide, rdivide, plus, minus. Additional help for built-in functions and operators is available in the online version of the manual. Use the command 'doc ' to search the manual index. Help and information about Octave is also available on the WWW at http://www.octave.org and via the help@octave.org mailing list. octave:9> help mldivide 'mldivide' is a built-in function from the file libinterp/corefcn/data.cc -- Built-in Function: mldivide (X, Y) Return the matrix left division of X and Y. This function and x \ y are equivalent. See also: mrdivide, ldivide, rdivide. Additional help for built-in functions and operators is available in the online version of the manual. Use the command 'doc ' to search the manual index. Help and information about Octave is also available on the WWW at http://www.octave.org and via the help@octave.org mailing list. octave:10> x x = 0.172178 0.033254 -0.460236 0.639453 octave:11> A'\b' ans = 0.172178 0.033254 -0.460236 0.639453 octave:12> P=rand(4) P = 0.0678571 0.2851214 0.3552969 0.5736913 0.3527116 0.4814736 0.3109436 0.2515370 0.6808220 0.7775641 0.1078582 0.4311683 0.5702615 0.0093576 0.0487433 0.4301897 octave:13> [V,D]=eig(P') V = -0.561699 -0.782680 0.236651 0.343272 -0.460727 -0.184959 -0.740278 -0.605752 -0.300531 0.519595 0.550777 -0.097326 -0.617986 0.288486 -0.304352 0.711166 D = Diagonal Matrix 1.34884 0 0 0 0 -0.51096 0 0 0 0 -0.18434 0 0 0 0 0.43384 octave:14> V(:,3)'*P ans = -0.043625 0.136466 -0.101533 0.056106 octave:15> D(3,3)*V(:,3)' ans = -0.043625 0.136466 -0.101533 0.056106 octave:16> P'*V ans = -0.757640 0.399916 -0.043625 0.148926 -0.621445 0.094506 0.136466 -0.262802 -0.405367 -0.265491 -0.101533 -0.042224 -0.833562 -0.147404 0.056106 0.308535 octave:17> V*D ans = -0.757640 0.399916 -0.043625 0.148926 -0.621445 0.094506 0.136466 -0.262802 -0.405367 -0.265491 -0.101533 -0.042224 -0.833562 -0.147404 0.056106 0.308535 octave:18> norm(V) ans = 1.1838 octave:19> norm(V(:,1)) ans = 1 octave:20> norm(V(:,2)) ans = 1.00000 octave:21> norm(V(:,3)) ans = 1 octave:22> norm(V(:,4)) ans = 1 octave:23> P=[1,1;0,1] P = 1 1 0 1 octave:24> [V,D]=eig(P) V = 1.00000 -1.00000 0.00000 0.00000 D = Diagonal Matrix 1 0 0 1 octave:25> P=randstoc(4) error: 'randstoc' undefined near line 1 column 3 octave:25> ls 2016-11-17.txt equazioni_differenziali sistemi_stocastici octave:26> cd sistemi_stocastici/ octave:27> ls randstoc.m octave:28> P=randstoc(4) P = 0.058152 0.410792 0.316781 0.214276 0.354040 0.162810 0.420035 0.063115 0.074464 0.315912 0.262675 0.346950 0.087445 0.199051 0.393199 0.320305 octave:29> sum(P,2) ans = 1.00000 1.00000 1.00000 1.00000 octave:30> P P = 0.058152 0.410792 0.316781 0.214276 0.354040 0.162810 0.420035 0.063115 0.074464 0.315912 0.262675 0.346950 0.087445 0.199051 0.393199 0.320305 octave:2> P=randstoc(4); octave:3> invariantPotenze(P,1e-6,100) ans = 0.20693 0.22687 0.29040 0.27580 octave:4> v=invariantPotenze(P,1e-6,100) v = 0.20693 0.22687 0.29040 0.27580 octave:5> v*P ans = 0.20693 0.22687 0.29040 0.27580 octave:6> P=[0,1;1,0] P = 0 1 1 0 octave:7> v=invariantPotenze(P,1e-6,100) warning: Impossibile raggiungere la tolleranza richiesta warning: entro il numero massimo di iterazioni consentito. v = 0.63259 0.36741 octave:8> v=invariantPotenze(P,1e-6,100) warning: Impossibile raggiungere la tolleranza richiesta warning: entro il numero massimo di iterazioni consentito. v = 0.32007 0.67993 octave:9> v=invariantPotenze(P,1e-6,100) warning: Impossibile raggiungere la tolleranza richiesta warning: entro il numero massimo di iterazioni consentito. v = 0.58414 0.41586 octave:10> [0.5,0.5]*P ans = 0.50000 0.50000 octave:11> [V,D]=eig(P') V = -0.70711 0.70711 0.70711 0.70711 D = Diagonal Matrix -1 0 0 1 octave:12> P=[1,0;0,1] P = 1 0 0 1 octave:13> v=invariantPotenze(P,1e-6,100) v = 0.27444 0.72556 octave:14> v=invariantPotenze(P,1e-6,100) v = 0.47872 0.52128 octave:15> v=invariantPotenze(P,1e-6,100) v = 0.69674 0.30326 octave:16> P=randstoc(4) P = 0.076939 0.316202 0.292737 0.314122 0.578025 0.278882 0.050846 0.092247 0.312549 0.509347 0.057566 0.120538 0.425954 0.135369 0.370180 0.068498 octave:17> zeros(1,4)/(P-eye(4)) warning: matrix singular to machine precision, rcond = 9.88841e-18 ans = 0 0 0 0 octave:18> v=[zeros(1,4),1]/[(P-eye(4)),ones(4,1)] v = 0.33504 0.31033 0.18675 0.16788 octave:19> sum(v) ans = 1.00000 octave:20> v*P ans = 0.33504 0.31033 0.18675 0.16788 octave:21> P=eye(2) P = Diagonal Matrix 1 0 0 1 octave:22> octave:22> P=eye(4) P = Diagonal Matrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 octave:23> v=[zeros(1,4),1]/[(P-eye(4)),ones(4,1)] v = 0.25000 0.25000 0.25000 0.25000 octave:24> diary off