How to use the "Input" command-- specific problem help
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I don't understand how to do the input command.. can someone help me?
The figure attached shows a cylindrical tank of height H and radius r, with a spherical cap on each end (also of radius r). The height of the liquid in the tank is h. Use the input command to obtain values for H, r & h and compute the volume of liquid in the tank.
The calculation of the volume of liquid in the tank depends upon the relationship between h, H and r:
• If h is less than r, we need the volume of a partially-filled sphere
• If h is greater than r but less than H-r, we need the volume of a fully- filed hemisphere plus the volume of a cylinder of height h-r
• If h is greater than H-r, we need the volume of a fully-filled sphere, plus the volume of a cylinder of height H-2r, minus the partially empty upper hemisphere of height H-h
• If h is greater than H, the function should generate an error message (using error)
Risposte (1)
Amit
il 2 Feb 2014
The input command ask for a value from the user, for example
A = input('Enter value for h: ')
will show on command prompt:
Enter value for h:
Where the user will provide the value and that value will be store in the variable, here A.
For more about input, type on command prompt
help input
0 Commenti
Vedere anche
Categorie
Scopri di più su Biological Physics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!