Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm a beginner in matlab, and I am attempting to solve an equation for a water tank (seen below). I have written my own code
I'm a beginner in matlab, and I am attempting to solve an equation for a water tank (seen below).
I have written my own code and part of it is working well but I am having trouble with my last 'else' statement, when d
It's line 9 that is incorrect. I am supposed to be writing a formula for the volume of water in the tank when the water is in the cone, and the radius of the cone can be taken to be the depth of the water. I am having a lot of trouble fixing the formula, and any suggestion to help me fix it would be greatly appreciated.
Courses LMS Integration Documentation Engr 240 W20 > Assignment 2 > (10 points) Problem 2.2 - Water tank O solutions submitted (max: Unlimited) A water tank is designed with a conical section and a cylindrical section and all dimensions related to the radius, R, as shown in the figure below: R- Write a function that accepts the depth, d, of the water and the characteristic dimension, R, and calculates the total volume of water stored in the tank. Your function should calculate the volume correctly regardless of the depth and return a value of 999 for the case when d > 3R (i.e. the tank is overflowing). Supplemental Deliverables (2 points): For supplemental deliverables, you do not need to run your code in Matlab Grader. You have to turn in a hard copy of what is asked. Use the function to calculate the volume as a function of d for R = 1.5 and d ranging from 0 to 4.5 in increments of 0.3. Print your results for volume vs. depth (values and plot). Function Reset MATLAB Documentation W NP function volume = tank(d, R) if d>3*R volume=999; elseif dStep 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