Syntax for Displaying Units
이전 댓글 표시
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
Geoff Hayes
2015년 2월 1일
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?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 String Parsing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!