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
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:6| Question number:2.6
All Answers
total answers (1)
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