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.

3 ビュー (過去 30 日間)
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.

採用された回答

Walter Roberson
Walter Roberson 2016 年 10 月 19 日
Okay, I've done it. Now what?

その他の回答 (1 件)

Tushar
Tushar 2025 年 1 月 12 日
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
  2 件のコメント
Walter Roberson
Walter Roberson 2025 年 1 月 12 日

we do not recommend posting complete solutions to homework problems

DGM
DGM 2025 年 1 月 12 日
To be fair, it's not a function, so I'd argue that the bulk of the actual non-obvious language-specific lesson hasn't been revealed.

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by