ans = diary-2008-01-31 uiopen('/Users/ausas/Documents/CS4/MATLAB/work/Ex2_2.m',1) % Modify expression to add input arguments. % Example: % a = [1 2 3; 4 5 6]; % foo(a); Ex2_2 C2C4 = 33.5051 Ts=38; T0=120; k=0.45; t=3; t=round(Ts+(T0-Ts)*exp(-k*t)) t = 59 uiopen('/Users/ausas/Documents/CS4/MATLAB/work/Ex2_4.m',1) % Modify expression to add input arguments. % Example: % a = [1 2 3; 4 5 6]; % foo(a); Ex2_4 B = 2.0011e+04 t = 16.3737 years = 16 months = 5 yr=[1984 1986 1988 1990 1992 1994 1996] yr = Columns 1 through 3 1984 1986 1988 Columns 4 through 6 1990 1992 1994 Column 7 1996 pop=[127; 130; 136; 145; 158; 178; 211] pop = 127 130 136 145 158 178 211 pntA=[2, 4, 5] pntA = 2 4 5 pntA = [2 4 5] pntA = 2 4 5 x=[1:2:13] x = Columns 1 through 6 1 3 5 7 9 11 Column 7 13 y=[1.5:0.1:2.1] y = Columns 1 through 3 1.5000 1.6000 1.7000 Columns 4 through 6 1.8000 1.9000 2.0000 Column 7 2.1000 z=[-3:7] z = Columns 1 through 6 -3 -2 -1 0 1 2 Columns 7 through 11 3 4 5 6 7 xa=[21:-3:6] xa = 21 18 15 12 9 6 x=[1:2:10] x = 1 3 5 7 9 va=linspace(0,8,6) va = Columns 1 through 3 0 1.6000 3.2000 Columns 4 through 6 4.8000 6.4000 8.0000 vb=linspace(30,10,11) vb = Columns 1 through 6 30 28 26 24 22 20 Columns 7 through 11 18 16 14 12 10 u=linspace(49.5,0.5) u = Columns 1 through 3 49.5000 49.0051 48.5101 Columns 4 through 6 48.0152 47.5202 47.0253 Columns 7 through 9 46.5303 46.0354 45.5404 Columns 10 through 12 45.0455 44.5505 44.0556 Columns 13 through 15 43.5606 43.0657 42.5707 Columns 16 through 18 42.0758 41.5808 41.0859 Columns 19 through 21 40.5909 40.0960 39.6010 Columns 22 through 24 39.1061 38.6111 38.1162 Columns 25 through 27 37.6212 37.1263 36.6313 Columns 28 through 30 36.1364 35.6414 35.1465 Columns 31 through 33 34.6515 34.1566 33.6616 Columns 34 through 36 33.1667 32.6717 32.1768 Columns 37 through 39 31.6818 31.1869 30.6919 Columns 40 through 42 30.1970 29.7020 29.2071 Columns 43 through 45 28.7121 28.2172 27.7222 Columns 46 through 48 27.2273 26.7323 26.2374 Columns 49 through 51 25.7424 25.2475 24.7525 Columns 52 through 54 24.2576 23.7626 23.2677 Columns 55 through 57 22.7727 22.2778 21.7828 Columns 58 through 60 21.2879 20.7929 20.2980 Columns 61 through 63 19.8030 19.3081 18.8131 Columns 64 through 66 18.3182 17.8232 17.3283 Columns 67 through 69 16.8333 16.3384 15.8434 Columns 70 through 72 15.3485 14.8535 14.3586 Columns 73 through 75 13.8636 13.3687 12.8737 Columns 76 through 78 12.3788 11.8838 11.3889 Columns 79 through 81 10.8939 10.3990 9.9040 Columns 82 through 84 9.4091 8.9141 8.4192 Columns 85 through 87 7.9242 7.4293 6.9343 Columns 88 through 90 6.4394 5.9444 5.4495 Columns 91 through 93 4.9545 4.4596 3.9646 Columns 94 through 96 3.4697 2.9747 2.4798 Columns 97 through 99 1.9848 1.4899 0.9949 Column 100 0.5000 a=[5 35 43; 4 76 81; 21 32 40] a = 5 35 43 4 76 81 21 32 40 b=[7 2 76 33 8 1 98 6 25 6 5 54 68 9 0] b = 7 2 76 33 8 1 98 6 25 6 5 54 68 9 0 a=[1 2 3; 4 5] ??? Error using ==> vertcat CAT arguments dimensions are not consistent. cd=6; e=3; h=4; mat=[e, cd*h, cos(pi/3); h^2, sqrt(h*h/cd), 14] mat = 3.0000 24.0000 0.5000 16.0000 1.6330 14.0000 a=[1:2:11; 0:5:25; linspace(10,60,6); 67 2 43 68 4 13) ??? a=[1:2:11; 0:5:25; linspace(10,60,6); 67 2 43 68 4 13) | Error: Unbalanced or unexpected parenthesis or bracket. a=[1:2:11; 0:5:25; linspace(10,60,6); 67 2 43 68 4 13)] ??? a=[1:2:11; 0:5:25; linspace(10,60,6); 67 2 43 68 4 13)] | Error: Unbalanced or unexpected parenthesis or bracket. a=[1:2:11; 0:5:25; linspace(10,60,6); 67 2 43 68 4 13] a = 1 3 5 7 9 11 0 5 10 15 20 25 10 20 30 40 50 60 67 2 43 68 4 13 zr=zeros(3,4) zr = 0 0 0 0 0 0 0 0 0 0 0 0 ne=ones(4,3) ne = 1 1 1 1 1 1 1 1 1 1 1 1 idn=eye(5) idn = 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 aa=[3 8 1] aa = 3 8 1 bb=aa' bb = 3 8 1 c=[2 55 14 8; 21 5 32 11; 41 64 9 1] c = 2 55 14 8 21 5 32 11 41 64 9 1 d=c' d = 2 21 41 55 5 64 14 32 9 8 11 1 vct=]35 46 78 23 5 14 81 3 55] ??? vct=]35 46 78 23 5 14 81 3 55] | Error: Unbalanced or unexpected parenthesis or bracket. vct=[35 46 78 23 5 14 81 3 55] vct = Columns 1 through 6 35 46 78 23 5 14 Columns 7 through 9 81 3 55 vct(4) ans = 23 vct(6)=273 vct = Columns 1 through 6 35 46 78 23 5 273 Columns 7 through 9 81 3 55 vct(2)+vct(8) ans = 49 mat=[3 11 6 5; 4 7 10 2;13 9 0 8] mat = 3 11 6 5 4 7 10 2 13 9 0 8 mat(3,10 ??? mat(3,10 | Error: Expression or statement is incorrect--possibly unbalanced (, {, or [. mat(3,100 ??? mat(3,100 | Error: Expression or statement is incorrect--possibly unbalanced (, {, or [. mat(3,10) ??? Index exceeds matrix dimensions. mat(3,1) ans = 13 mat(3,1)=20 mat = 3 11 6 5 4 7 10 2 20 9 0 8 v=[4 15 8 12 34 2 50 23 11] v = Columns 1 through 6 4 15 8 12 34 2 Columns 7 through 9 50 23 11 u=v(3:7) u = 8 12 34 2 50 a=[1 3 5 7 9 11; 2 4 6 8 10 12; 3 6 9 12 15 18; 4 8 12 16 20 24;5 10 15 20 25 30] a = 1 3 5 7 9 11 2 4 6 8 10 12 3 6 9 12 15 18 4 8 12 16 20 24 5 10 15 20 25 30 b=a(:,3) b = 5 6 9 12 15 c=a(2,:) c = 2 4 6 8 10 12 e=a(2:4,:) e = 2 4 6 8 10 12 3 6 9 12 15 18 4 8 12 16 20 24 f=a(1:3,2:4) f = 3 5 7 4 6 8 6 9 12 v=4:3:34 v = Columns 1 through 6 4 7 10 13 16 19 Columns 7 through 11 22 25 28 31 34 u=v([3, 5, 7:10]) u = 10 16 22 25 28 31