Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Programmatically determine the maximum Kelvin temperature in your data set. Usin

ID: 3767418 • Letter: P

Question

Programmatically determine the maximum Kelvin temperature in your data set. Using fprintf, print the results from the prompts in this paragraph to the screen with appropriate labels and units. Create an m Times m matrix of uniformly distributed pseudorandom numbers for the case of m = 3 and n = 5. Hard code the variables m and n, create your matrix, then programmatically determine the size of the matrix; if done correctly, you should see that this matches your original dimension. Using this knowledge (i.e. using the results from your size calculation), use nested for loops (i.e. a for loop inside of another for loop) to loop through each element of the matrix. On each pass, if an element of the matrix is less than 0.23 overwrite its value with -1; otherwise, change nothing about it. Pragmatically print both the original and the modified matrix; the easiest way to do this would be to use disp command(s); you may, for convenience, list the label for the matrix on a separate line. Repeat this problem with a new m Times n matrix of normally distributed pseudorandom numbers, however instead of nested for loops like you did before, use find command(s). Calculate how many elements of this matrix had values less than 0.23 from the matrix. Use a disp statement to print a sentence to the screen that states this result; a statement to the effect of "There were X numbers that were less than 0.23" will suffice, but note that instead of X, you'll have the actual number of times MATLAB encountered a number less than 0.23 in the matrix. Pragmatically print both the original and the modified matrix; the easiest way to do this would be to use disp command(s); you may, for convenience, list the label for the matrix on a separate line.

Explanation / Answer

Program: