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
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