matlab hw 4 - Matlab Hw Set # 4 Problem #1 x=[1950:2010] x...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Matlab Hw Set # 4 Problem #1 x=[1950:2010] x = Columns 1 through 9 1950 1951 1952 1953 1954 1955 1956 1957 1958 Columns 10 through 18 1959 1960 1961 1962 1963 1964 1965 1966 1967 Columns 19 through 27 1968 1969 1970 1971 1972 1973 1974 1975 1976 Columns 28 through 36 1977 1978 1979 1980 1981 1982 1983 1984 1985 Columns 37 through 45 1986 1987 1988 1989 1990 1991 1992 1993 1994 Columns 46 through 54 1995 1996 1997 1998 1999 2000 2001 2002 2003 Columns 55 through 61 2004 2005 2006 2007 2008 2009 2010 y=[243 137 87 104 113 199 54 84 121 77 88 205 36 118 170 84 145 122 35 158 34 97 28 43 61 73 81 25 62 91 147 93 29 17 71 88 36 34 103 135 91 34 75 39 32 228 166 40 182 177 116 106 65 175 225 248 79 72 145 51 62] y = Columns 1 through 9 243 137 87 104 113 199 54 84 121 Columns 10 through 18 77 88 205 36 118 170 84 145 122 Columns 19 through 27 35 158 34 97 28 43 61 73 81 Columns 28 through 36 25 62 91 147 93 29 17 71 88 Columns 37 through 45 36 34 103 135 91 34 75 39 32 Columns 46 through 54 228 166 40 182 177 116 106 65 175 Columns 55 through 61 225 248 79 72 145 51 62 plot(x,y)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
mean(y) ans = 100.5902 running_avg_y=filter(ones(1,10)/10,1,y); plot(x,y); xlabel('year'); ylabel('ace value'); title('ace value vs year'); grid on; Problem 2 Po=1000 1000 r= 0.08 0.08 t= [1:30] t = Columns 1 through 19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Columns 20 through 30 20 21 22 23 24 25 26 27 28 29 30 P=Po*exp(r*t) P = 1.0e+004 * Columns 1 through 13 0.1083 0.1174 0.1271 0.1377 0.1492 0.1616 0.1751 0.1896 0.2054 0.2226 0.2411 0.2612 0.2829 Columns 14 through 26 0.3065 0.3320 0.3597 0.3896 0.4221 0.4572 0.4953 0.5366 0.5812 0.6297 0.6821 0.7389 0.8004 Columns 27 through 30 0.8671 0.9393 1.0176 1.1023 fprintf('\n'); fprintf('P t Po r\n'); P t Po r fprint('------------------\n'); fprintf('%2d %6.4f %6.2f %-2s %-3s\n') t r Po P 1 0.08 1000 0.1083 2 0.08 1000 0.1174 3 0.08 1000 0.1271
Background image of page 2
4 0.08 1000 0.1377 5 0.08 1000 0.1492 6 0.08 1000 0.1616 7 0.08 1000 0.1751 8 0.08 1000 0.1896 9 0.08 1000 0.2054 10 0.08 1000 0.2226 11 0.08 1000 0.2411 12 0.08 1000 0.2612 13 0.08 1000 0.2829 14 0.08 1000 0.3065 15 0.08 1000 0.332 16 0.08 1000 0.3597 17 0.08 1000 0.3896 18 0.08 1000 0.4221 19 0.08 1000 0.4572 20 0.08 1000 0.4953 21 0.08 1000 0.5366 22 0.08 1000 0.5812 23 0.08 1000 0.6297 24 0.08 1000 0.6821 25 0.08 1000 0.7389 26 0.08 1000 0.8004 27 0.08 1000 0.8671 28 0.08 1000 0.9393 29 0.08 1000 1.0176 30 0.08 1000 1.1023 plot(t,P) xlabel('t') ylabel('P') title('Graph of P vs t'); semilogx(t) xlabel('t') ylabel('P') title('Graph of P versus t') semilogy(P) xlabel('t') ylabel('P') title('Graph of P versus t')
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
loglog(t,P) ylabel('P') xlabel('t') I think the plotting technique in which we had to logarithmically scale both the x and y axes was the best. Problem 3
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/26/2012 for the course ENGINEERIN 440:127 taught by Professor Blase during the Spring '10 term at Rutgers.

Page1 / 23

matlab hw 4 - Matlab Hw Set # 4 Problem #1 x=[1950:2010] x...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online