2+4 ans = 6 format compact pi ans = 3.1416 format long pi ans = 3.141592653589793 sqrt(2) ans = 1.414213562373095 format rat pi ans = 355/113 format pi ans = 3.1416 format compact e {Undefined function or variable 'e'.} exp(1) ans = 2.7183 sin(pi) ans = 1.2246e-16 ln(1) {Undefined function or variable 'ln'.} log(1) ans = 0 log(2.718281) ans = 1.0000 a = 1 a = 1 a=1.2 a = 1.2000 a(3) = 5 a = 1.2000 0 5.0000 a(5,2) = -1 a = 1.2000 0 5.0000 0 0 0 0 0 0 0 0 0 0 -1.0000 0 b(2,3) = 0 b = 0 0 0 0 0 0 b = zeros(2,3) b = 0 0 0 0 0 0 b = ones(2,3) b = 1 1 1 1 1 1 -5*b ans = -5 -5 -5 -5 -5 -5 eye(4) ans = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ones(4) ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ones(1,4) ans = 1 1 1 1 1:10 ans = 1 2 3 4 5 6 7 8 9 10 1:2:10 ans = 1 3 5 7 9 1:-2:-10 ans = 1 -1 -3 -5 -7 -9 -pi:.5:-pi ans = -3.1416 -pi:.5:pi ans = Columns 1 through 9 -3.1416 -2.6416 -2.1416 -1.6416 -1.1416 -0.6416 -0.1416 0.3584 0.8584 Columns 10 through 13 1.3584 1.8584 2.3584 2.8584 rand(3) ans = 0.8147 0.9134 0.2785 0.9058 0.6324 0.5469 0.1270 0.0975 0.9575 rand(3) ans = 0.9649 0.9572 0.1419 0.1576 0.4854 0.4218 0.9706 0.8003 0.9157 rand(3) ans = 0.7922 0.0357 0.6787 0.9595 0.8491 0.7577 0.6557 0.9340 0.7431 rand(3) ans = 0.3922 0.7060 0.0462 0.6555 0.0318 0.0971 0.1712 0.2769 0.8235 rand(3) ans = 0.6948 0.0344 0.7655 0.3171 0.4387 0.7952 0.9502 0.3816 0.1869 rand ans = 0.4898 rand ans = 0.4456 rand ans = 0.6463 rand ans = 0.7094 A = [ 1 2 3 ; 2 3 5; 1 0 -1 ] A = 1 2 3 2 3 5 1 0 -1 eig(A) ans = 4.7664 -0.2828 -1.4836 B = rand(5) B = 0.7547 0.1190 0.2238 0.8909 0.2575 0.2760 0.4984 0.7513 0.9593 0.8407 0.6797 0.9597 0.2551 0.5472 0.2543 0.6551 0.3404 0.5060 0.1386 0.8143 0.1626 0.5853 0.6991 0.1493 0.2435 eig(B) ans = 2.5109 + 0.0000i 0.6185 + 0.0000i -0.5118 + 0.0000i -0.3637 + 0.4470i -0.3637 - 0.4470i .6-.7i ans = 0.6000 - 0.7000i (.6-.7i)*(.6+.7i) ans = 0.8500 (.8-.7i)*(.8+.7i) ans = 1.1300 u = eig(B) u = 2.5109 + 0.0000i 0.6185 + 0.0000i -0.5118 + 0.0000i -0.3637 + 0.4470i -0.3637 - 0.4470i u930 {Undefined function or variable 'u930'.} u(3) ans = -0.5118 [u,v] = eig(B) u = 0.3616 + 0.0000i 0.7810 + 0.0000i -0.2206 + 0.0000i 0.1277 + 0.2026i 0.1277 - 0.2026i 0.5768 + 0.0000i -0.4827 + 0.0000i -0.5100 + 0.0000i -0.2756 + 0.3349i -0.2756 - 0.3349i 0.4936 + 0.0000i -0.0003 + 0.0000i 0.7278 + 0.0000i 0.6469 + 0.0000i 0.6469 + 0.0000i 0.4094 + 0.0000i 0.0585 + 0.0000i 0.2818 + 0.0000i -0.3561 - 0.1106i -0.3561 + 0.1106i 0.3540 + 0.0000i -0.3919 + 0.0000i -0.2866 + 0.0000i -0.1092 - 0.4302i -0.1092 + 0.4302i v = 2.5109 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.6185 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.5118 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.3637 + 0.4470i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.3637 - 0.4470i u(1,1) ans = 0.3616 u(3,3) ans = 0.7278 u(:,1) ans = 0.3616 0.5768 0.4936 0.4094 0.3540 u(5,:) ans = 0.3540 + 0.0000i -0.3919 + 0.0000i -0.2866 + 0.0000i -0.1092 - 0.4302i -0.1092 + 0.4302i B*u(:,1) ans = 0.9079 1.4484 1.2393 1.0279 0.8888 2.5109*u(:,1) ans = 0.9079 1.4484 1.2393 1.0279 0.8888 B B = 0.7547 0.1190 0.2238 0.8909 0.2575 0.2760 0.4984 0.7513 0.9593 0.8407 0.6797 0.9597 0.2551 0.5472 0.2543 0.6551 0.3404 0.5060 0.1386 0.8143 0.1626 0.5853 0.6991 0.1493 0.2435 B(2:4,2:4) ans = 0.4984 0.7513 0.9593 0.9597 0.2551 0.5472 0.3404 0.5060 0.1386 B([1 5],[1 5]) ans = 0.7547 0.2575 0.1626 0.2435 diag(B) ans = 0.7547 0.4984 0.2551 0.1386 0.2435 diag(diag(B)) ans = 0.7547 0 0 0 0 0 0.4984 0 0 0 0 0 0.2551 0 0 0 0 0 0.1386 0 0 0 0 0 0.2435 RJ R = 1.0000 1.2000 J = 1.0000 0.8000 R = 1.0000 1.2000 1.2400 J = 1.0000 0.8000 0.6000 R = Columns 1 through 3 1.0000 1.2000 1.2400 Column 4 1.1680 J = Columns 1 through 3 1.0000 0.8000 0.6000 Column 4 0.4160 R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 5 1.1680 1.0256 J = Columns 1 through 3 1.0000 0.8000 0.6000 Columns 4 through 5 0.4160 0.2576 R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 J = Columns 1 through 3 1.0000 0.8000 0.6000 Columns 4 through 6 0.4160 0.2576 0.1293 R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Column 7 0.6573 J = Columns 1 through 3 1.0000 0.8000 0.6000 Columns 4 through 6 0.4160 0.2576 0.1293 Column 7 0.0317 R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Columns 7 through 8 0.6573 0.4760 J = Columns 1 through 3 1.0000 0.8000 0.6000 Columns 4 through 6 0.4160 0.2576 0.1293 Columns 7 through 8 0.0317 -0.0372 R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Columns 7 through 9 0.6573 0.4760 0.3146 J = Columns 1 through 3 1.0000 0.8000 0.6000 Columns 4 through 6 0.4160 0.2576 0.1293 Columns 7 through 9 0.0317 -0.0372 -0.0811 R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Columns 7 through 9 0.6573 0.4760 0.3146 Column 10 0.1797 J = Columns 1 through 3 1.0000 0.8000 0.6000 Columns 4 through 6 0.4160 0.2576 0.1293 Columns 7 through 9 0.0317 -0.0372 -0.0811 Column 10 -0.1044 R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Columns 7 through 9 0.6573 0.4760 0.3146 Columns 10 through 11 0.1797 0.0735 J = Columns 1 through 3 1.0000 0.8000 0.6000 Columns 4 through 6 0.4160 0.2576 0.1293 Columns 7 through 9 0.0317 -0.0372 -0.0811 Columns 10 through 11 -0.1044 -0.1120 RJ R = 1.0000 1.2000 J = 1.0000 0.8000 R = 1.0000 1.2000 1.2400 J = 1.0000 0.8000 0.6000 R = 1.0000 1.2000 1.2400 1.1680 J = 1.0000 0.8000 0.6000 0.4160 R = 1.0000 1.2000 1.2400 1.1680 1.0256 J = 1.0000 0.8000 0.6000 0.4160 0.2576 R = 1.0000 1.2000 1.2400 1.1680 1.0256 0.8467 J = 1.0000 0.8000 0.6000 0.4160 0.2576 0.1293 R = Columns 1 through 6 1.0000 1.2000 1.2400 1.1680 1.0256 0.8467 Column 7 0.6573 J = Columns 1 through 6 1.0000 0.8000 0.6000 0.4160 0.2576 0.1293 Column 7 0.0317 R = Columns 1 through 6 1.0000 1.2000 1.2400 1.1680 1.0256 0.8467 Columns 7 through 8 0.6573 0.4760 J = Columns 1 through 6 1.0000 0.8000 0.6000 0.4160 0.2576 0.1293 Columns 7 through 8 0.0317 -0.0372 R = Columns 1 through 6 1.0000 1.2000 1.2400 1.1680 1.0256 0.8467 Columns 7 through 9 0.6573 0.4760 0.3146 J = Columns 1 through 6 1.0000 0.8000 0.6000 0.4160 0.2576 0.1293 Columns 7 through 9 0.0317 -0.0372 -0.0811 R = Columns 1 through 6 1.0000 1.2000 1.2400 1.1680 1.0256 0.8467 Columns 7 through 10 0.6573 0.4760 0.3146 0.1797 J = Columns 1 through 6 1.0000 0.8000 0.6000 0.4160 0.2576 0.1293 Columns 7 through 10 0.0317 -0.0372 -0.0811 -0.1044 R = Columns 1 through 6 1.0000 1.2000 1.2400 1.1680 1.0256 0.8467 Columns 7 through 11 0.6573 0.4760 0.3146 0.1797 0.0735 J = Columns 1 through 6 1.0000 0.8000 0.6000 0.4160 0.2576 0.1293 Columns 7 through 11 0.0317 -0.0372 -0.0811 -0.1044 -0.1120 a = 5 a = 5 a = 5; b = 5; b b = 5 RJ RJ RJ RJ RJ grid RJ RJ RJ RJ RJ RJ RJ RJ RJ close all RJ R R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Columns 7 through 9 0.6573 0.4760 0.3146 Columns 10 through 12 0.1797 0.0735 -0.0045 Columns 13 through 15 -0.0572 -0.0885 -0.1027 Columns 16 through 18 -0.1041 -0.0967 -0.0840 Columns 19 through 21 -0.0686 -0.0527 -0.0376 Columns 22 through 24 -0.0244 -0.0134 -0.0049 Columns 25 through 27 0.0013 0.0054 0.0078 Columns 28 through 30 0.0087 0.0087 0.0080 Columns 31 through 33 0.0069 0.0055 0.0042 Columns 34 through 36 0.0030 0.0019 0.0010 Columns 37 through 39 0.0003 -0.0002 -0.0005 Columns 40 through 41 -0.0007 -0.0007 RJ R R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Columns 7 through 9 0.6573 0.4760 0.3146 Columns 10 through 11 0.1797 0.0735 R R = Columns 1 through 3 1.0000 1.2000 1.2400 Columns 4 through 6 1.1680 1.0256 0.8467 Columns 7 through 9 0.6573 0.4760 0.3146 Columns 10 through 11 0.1797 0.0735 clear all R {Undefined function or variable 'R'.} RJ R {Undefined function or variable 'R'.} diary off