Q:

Write a function that will receive as an input argument a number of kilometers (K). The function will convert the kilometers to miles and to U.S. nautical miles, and return both results. The conversions are: 1K = 0.621 miles and 1 US nautical mile = 1.852 K

0

Write a function that will receive as an input argument a number of kilometers (K). The function will convert the kilometers to miles and to U.S. nautical miles, and return both results. The conversions are: 1K = 0.621 miles and 1 US nautical mile = 1.852 K.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

kToMilesNaut.m

function [miles, nautmiles] = kToMilesNaut(kms)

% Converts a distance in kilometers to miles and U.S. nautical miles

% Format kToMilesNaut(kilometers)

% Returns miles and then nautical miles

 miles = kms .* 0.621;

 nautmiles = kms ./ 1.852;

 end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now