prompt = 'Enter mass in pounds:';
x = input(prompt);
y = x*0.4536;
disp (y);
This is my current script and i want to have the answer display with 'kg' next to the answer and i cant figure out how to do it.

 Akzeptierte Antwort

Elysi Cochin
Elysi Cochin am 22 Mär. 2020
Bearbeitet: Elysi Cochin am 22 Mär. 2020

1 Stimme

fprintf('%g kg\n', y)

Weitere Antworten (0)

Kategorien

Mehr zu Entering Commands finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by