Needs to be solved by a script in MATLAB. Use of if, else, and ifelse statements are encouraged. My main issue is figuring out what order to place if statements in. Please comment if any more info is needed
Please find required MATLAB code along with necessary details in comments:
H1=25;
H2=25;
D=40;
r=D/2;
depth=input('Enter the height of water in the tank:');
if depth<=0
fprintf('Negative depths are not possible. ');
Volume=[];
elseif (depth<=H1)
Volume=pi*r*r*depth;
fprintf('There is %3.4f ft^3 waterin the tank.\n ',Volume);
elseif (depth>H1) & (depth<=H1+H2)
Volume=(pi*r*r*H1)+ (((1/3)*pi*r*r*(depth-H1)));
fprintf('There is %3.4f ft^3 waterin the tank.\n ',Volume);
else
fprintf('ERROR: You entered a height which is greater than the
height of the tank, which is not possible.\n')
end
=========================== SCREENSHOT OF CODE
========================================= SAMPLE OUTPUT
Create a script file which prompts the user for the water level of the tank pictured below. The t...
1) First, the script prompts user to input the volume of the rigid container in cubic meters 2) Second, the script prompts user to input the total mass of the water (in any phase) in the tank 3) Third, the script prompts user to input the initial temperature 4) Fourth, the script prompts user to input the initial mixture quality Thereafter, the script computes the state at which all of the water is transformed to saturated vapor, and the energy...
A fluid of constant density (p) at 40 °F (T) is flowing into an initially empty cylindrical tank of radius 10 ft. The cylindrical vešsel is jacketed and heated with saturated steam (T) at 212 °F.The steam jacket does not cover either the top or bottom of the tank. The heat capacity of liquid (Cp liquid is near to that of water. The vessel is well stirred and the heat resistance of the jacket is negligible as are the heat...
Need just the results. Thank you! rate. The tank has height 6 m and the diameter at the top is 4 m. If the water level is rising at a rate of 20 cm/min when find the rate at which water is being pumped into the tank. (Round your answer to the nearest integer.) 290253 cm3/min Need Help? Resd Watch iTalk to a Tutor Submit Answer Save Progress Practice Another Version o 01 points | Previous Answers SCalcET8 3 9...
In Matlab Create a single script (.m file) to solve these problems. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. For this project, suppress your output with semi-colons (;). Each problem should be in a separate cell, using the cell mode feature of MATLAB. Problem 4 Video games are rather complicated to program, not least of which because of the graphics work that needs to be completed...
we want to design a hydraulic system for which we will use a pump with an impeller of 28 inches in diameter, whose characteristic curve is shown, operating with water at 20 degrees Celsius and with an expense of 14000 gal / min. The system will have cast iron pipe 12 inches in diameter and a total length in the portion of the boma suction of 65 feet. Calculate: a) The power of the pump drive in HP. b) The...
could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...