Home > other >  Matlab input statement
Matlab input statement

Time:01-19

Genuinely don't know how to code and I need to change this to include an input to ask for the given lengths. This is my current code:

    tank_Volume(2.75, 3.0, 62.3)
    % b is base length in feet, h is height in feet
    %p is rho in lb/ft^3
    %volume in ft^3, m is mass in lb
    function [m] = tank_Volume(b, h, p)
    v = (b * h)/3;
    m = p * v;
    end

CodePudding user response:

If you are just asking for a front-end user interface, you can use the input( ) function:

b = input('Enter base length in feet ');
h = input('Enter height in feet ');
p = input('Enter rho in lb/ft^3 ');
m = tank_Volume(b,h,p);
  •  Tags:  
  • Related