Syntax for Displaying Units

5 views (last 30 days)
Jorge Bastillo
Jorge Bastillo on 30 Jan 2015
Commented: Geoff Hayes on 1 Feb 2015
G = 6.673*10^.11;
GRAVFORCE = (G*massbod1*massbod2)/planrad^.2;
%Provide user output
disp(['THE (body1) EXERTS A FORCE ON (body2) OF: ' , num2str(GRAVFORCE)])
disp('')
The variables have been input by the user and this is the end of my script... How can I get it to output Nm^2/kg^2?
  1 Comment
Geoff Hayes
Geoff Hayes on 1 Feb 2015
Jorge - what exactly do you want to output? The string 'Nm^2/kg^2' as
disp(['THE (body1) EXERTS A FORCE ON (body2) OF: ' num2str(GRAVFORCE) ' Nm^2/kg^2'])
or something else?

Sign in to comment.

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!