I need to make a computation that will return the answer with units.

1 view (last 30 days)
I wrote several programs with will make my desired computations successfully. my problem arises when I try to add a line that will allow the user to type in the units (feet for example) used then return that unit squared Ft^2 or square feet.
I have a program with will compute the area of a square successfully .
X=hight
y=base
fprintf (the area is %d \n x*y)
this program will return the area but i need to have units after the number (ft^2) and I need for the user to choose the units.

Answers (1)

the cyclist
the cyclist on 1 Sep 2014
You are not giving us much detail. Have you tried the input() function? Hm. I don't know, because you haven't told me.
  1 Comment
daniel
daniel on 1 Sep 2014
Edited: daniel on 1 Sep 2014
I have a program with will compute the area of a square successfully .
X=hight
y=base
fprintf (the area is %d \n x*y)
this program will return the area but i need to have units after the number (ft^2) and I need for the user to choose the units.

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!