1> t = linspace(0, 2*pi); 2> size(t) ans = 1 100 3> x = cos(t); y = sin(t); 4> A = [3 2; 2 3] A = 3 2 2 3 5> z = A * [x; y]; 6> size(z) ans = 2 100 7> plot(x,y) 8> axis equal 9> 9> hold on 10> plot(z(1,:), z(2,:), 'r') 11> [autovettori, lambda] = eig(A) autovettori = -0.70711 0.70711 0.70711 0.70711 lambda = Diagonal Matrix 1 0 0 5 12> x1 = autovettori(:,1) x1 = -0.70711 0.70711 13> x5 = autovettori(:,2) x5 = 0.70711 0.70711 14> plot([0,x1(1)], [0,x1(2)], 'b') 15> plot([0,x5(1)], [0,x5(2)], 'r') 16> % codice per il metodo delle potenze 16> help metpot `metpot' is a function from the file /home/achilles/metpot.m metodo delle potenze Additional help for built-in functions and operators is available in the on-line 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. 17> [lambda, y] = metpot(A, [-1; 1]) lambda = 5.0000 y = -0.70711 -0.70711 18> help cerchio `cerchio' is a function from the file /home/achilles/cerchio.m plot di un cerchio di centro c (numero complesso) e di raggio r Additional help for built-in functions and operators is available in the on-line 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. 19> hold off 20> cerchio(i,4) 21> grid on 22> hold off 23> gersh(A) 24> A A = 3 2 2 3 25> B = [i-2 4+3i 5i; 2i+5 7i 3; 2i+3 3 -i] B = -2 + 1i 4 + 3i 0 + 5i 5 + 2i 0 + 7i 3 + 0i 3 + 2i 3 + 0i -0 - 1i 26> gersh(B) 27> hold off 28> gersh(B) 29> % per calcolare l'autovalore 1 di A con lo shift -5 29> metpot(A-5*eye(2,2),ones(2,1)) warning: division by zero ans = NaN 30> metpot(A-5*eye(2,2),[2;4]) ans = -4.0000 31> quit