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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.