Using the built-in fprintf() function, display the scalar R_min followed by the
ID: 2079672 • Letter: U
Question
Using the built-in fprintf() function, display the scalar R_min followed by the scalar R_min_row_index using a single format string. Format scalar R_min as an integer and display its value according to the default MATLAB settings. Format scalar R_min_row_index as an integer and display its value within a 2-digit field width showing a minimum of 2 digits. After completing this step, you should see an output in the MATLAB Command Window similar to the example output shown below. The minimum value in matrix R is -198 and it resides in row #02.Explanation / Answer
R=round(100*randn(200,200));
R_min=min(min(R));
[R_min_row_index R_min_col_index]=find(R == R_min);
fprintf('The minimum value in matrix R is %d and it residues in row #%2d ',R_min,R_min_row_index);
OUTPUT:
The minimum value in matrix R is -425 and it residues in row #70
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.