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

The program should then use switch statement to obtain the total Force for the s

ID: 3789225 • Letter: T

Question

The program should then use switch statement to obtain the total Force for the selected weight and material. The program should also display the results after the computation using appropriate format statements. Display your results for the following values: 120lb for Rubber on concrete; 1001b for Metal on metal. Write a MATLAB program that creates the following square pattern, given the width (number of columns): You may use fprintf statements that print either a single asterisk (*) or a single blank. Maximize your use of repetition (with nested for structures) and minimize the number of fprintf statements. Run the program for columns = 7.

Explanation / Answer

for i=1:7
for j=1:i
fprintf '*'
end
fprintf ' '
end

explanation :

use a nested for loop to print both rows and columns.

print newline character after every line