CS1173MidtermpringPracticeKey.docx - MidTerm Practice 1...

This preview shows page 1 - 3 out of 6 pages.

MidTerm Practice.1. Basic array syntax. Suppose the MATLAB variable Aisdefined by:A = [6, -2, 5, 3; 2, 7, -4, -3]; What are the values of each of the following MATLAB expressions? Provide the resulting array/vector.a) Write Ain tabular form, showing the direction of dimension 1and dimension 26 , -2, 5, 2, 7, -4, b) mean(A) -3d) reshape(A,4,2).3-3
c) A(:) 652-4-232, -4-2, 37, -3e) min(A, [], 1)[ 2, -2,-4, -3 ]7-3d) reshape(A,4,2)6, 52, -4-2, 37, -3e) min(A, [], 1)[ 2, -2,-4, -3 ]1
2. Translating simple word problems into MATLAB: Suppose the Texas Department of Public Health is tracking the number of tuberculosis deaths in an array (TBDeaths, 30 x 45), representing the number of new tuberculosis related deaths in the 30 least populous counties (in order low to high) in Texas over the years 1963-2017. a) Draw a diagram of the TBDeathsarray and label the rows and columns.b) Define a MATLAB variable that contains the overall total number of TB deaths for all counties during the recording period.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture