clc clear all disp('PURPOSE') disp(' To show how to write your own BMI function') disp(' ') % INPUTS disp('INPUTS') weight = 180; height = 70; fprintf(' Your weight in lbs is = %g\n',weight) fprintf(' Your height in inches is = %g\n\n',height) % CODE [bmi,categ,target]=mybmi(weight,height); % OUTPUTS disp('OUTPUTS') fprintf(' Your BMI is = %g\n',bmi) fprintf(' You fall into %s category\n',categ) fprintf(' Your target weight is = %g lbs\n',target)