{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

matlab hw 4

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

This preview shows pages 1–7. Sign up to view the full content.

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)

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

View Full Document
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
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')

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

View Full Document
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 ko=10 ko = 10 Q=1000 Q = 1000 R=8.314 R = 8.3140 T=[300:1000] T = Columns 1 through 9 300 301 302 303 304 305 306 307 308 Columns 10 through 18 309 310 311 312 313 314 315 316 317 Columns 19 through 27 318 319 320 321 322 323 324 325 326 Columns 28 through 36 327 328 329 330 331 332 333 334 335 Columns 37 through 45 336 337 338 339 340 341 342 343 344 Columns 46 through 54 345 346 347 348 349 350 351 352 353 Columns 55 through 63 354 355 356 357 358 359 360 361 362 Columns 64 through 72
363 364 365 366 367 368 369 370 371 Columns 73 through 81 372 373 374 375 376 377 378 379 380 Columns 82 through 90 381 382 383 384 385 386 387 388 389 Columns 91 through 99 390 391 392 393 394 395 396 397 398 Columns 100 through 108 399 400 401 402 403 404 405 406 407 Columns 109 through 117 408 409 410 411 412 413 414 415 416 Columns 118 through 126 417 418 419 420 421 422 423 424 425 Columns 127 through 135 426 427 428 429 430 431 432 433 434 Columns 136 through 144 435 436 437 438 439 440 441 442 443 Columns 145 through 153 444 445 446 447 448 449 450 451 452 Columns 154 through 162 453 454 455 456 457 458 459 460 461 Columns 163 through 171 462 463 464 465 466 467 468 469 470 Columns 172 through 180 471 472 473 474 475 476 477 478 479 Columns 181 through 189 480 481 482 483 484 485 486 487 488 Columns 190 through 198 489 490 491 492 493 494 495 496 497 Columns 199 through 207 498 499 500 501 502 503 504 505 506 Columns 208 through 216

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

View Full Document
507 508 509 510 511 512 513 514 515 Columns 217 through 225 516 517 518 519 520 521 522 523 524 Columns 226 through 234 525 526 527 528 529 530 531 532 533 Columns 235 through 243 534 535 536 537 538 539 540 541 542 Columns 244 through 252 543 544 545 546 547 548 549 550 551 Columns 253 through 261 552 553 554 555 556 557 558 559 560 Columns 262 through 270 561 562 563 564 565 566 567 568 569 Columns 271 through 279 570 571 572 573 574 575 576 577 578 Columns 280 through 288 579 580 581 582 583 584 585 586 587 Columns 289 through 297 588 589 590 591 592 593 594 595 596
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 23

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

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

View Full Document
Ask a homework question - tutors are online