Answered step by step
Verified Expert Solution
Question
1 Approved Answer
HW 3: Loops and Conditional Statements (100 points) Problem 1 (25 points) Create an m-file that creates a multiplication table from 1 to a
HW 3: Loops and Conditional Statements (100 points) Problem 1 (25 points) Create an m-file that creates a multiplication table from 1 to a given number. (Hint: research nested loops) Problem 2 (25 points) Create an m-file that asks the user to input two integer values between 1 and 10. Use this as a seed to create a randomly sized matrix with random elements. Using conditional statements, check if the matrix is square and display the output along with the matrix's size. Problem 3 (50 points) The figure below shows a cylindrical tank with a conical base. If the liquid level, h, is in the conical part, the volume is simply the conical volume of the liquid. If the liquid level is midrange in the cylindrical part, the total volume of the liquid includes the filled conical part and the partially filled cylindrical part. KR h 1 2R R Write an m-file to compute the volume of liquid in the tank as a function of given values of R and h. Design the code so that it returns the volume for all cases when the depth is less than 3R. Return an error message "overtop" if the attempted tank volume is over the top of the tank. Include a listing of your Matlab code and Matlab output of the calculated results in your HW answer file. 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started