Write a function that receives an input argument of a number of kilometers (km) and will output the conversions into both miles (mi) and US nautical miles (n.m.). Use the conversions: 1 km = 0.621 mi and 1 km = 0.540 n.m.

5 visualizzazioni (ultimi 30 giorni)
Write a function that receives an input argument of a number of kilometers (km) and will output the conversions into both miles (mi) and US nautical miles (n.m.). Use the conversions: 1 km = 0.621 mi and 1 km = 0.540 n.m.

Risposta accettata

Walter Roberson
Walter Roberson il 19 Ott 2016
Okay, I've done it. Now what?

Più risposte (1)

Tushar
Tushar il 12 Gen 2025
x=input("Enter a valuein Km :");
Error using input
Support for user input is required, which is not available on this platform.
mi=x*0.621;
nm=x*0.540;
mi
nm

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by