part 1: Create Useful Functions.
Create the following functions in MATLAB and use the function names provided below!
kmout = MilesToKm(miles) % converts a value in miles to kilometers
kJoulesOut = CalTokJoules(DietaryCalories) % converts dietary calories (big calories) to kiloJoules (10^3 Joules = 1 kJ)
kWhrOut = KJoulesToKWHr(Kjoules) % converts kJoules to kilowatt hours
kmout = FeetTokm(feet) % converts feet to kilometers
secondsout = HoursToSeconds(hours) % converts hours to seconds
Each of the functions includ appropriate help comments that will respond to MATLAB's help command.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
1)
function kmout = MilesToKm(miles) % converts a value in miles to kilometers
kmout=miles*1.609;
end
2)
function kJoulesOut = CalTokJoules(DietaryCalories) % converts dietary calories (big calories) to kiloJoules (10^3 Joules = 1 kJ)
kJoulesOut=DietaryCalories*4.184;
end
3)
function kWhrOut = KJoulesToKWHr(Kjoules) % converts kJoules to kilowatt hours
kWhrOut=Kjoules/3600;
end
4)
function kmout = FeetTokm(feet) % converts feet to kilometers
kmout=feet/3280.84;
end
5)
function secondsout = HoursToSeconds(hours) % converts hours to seconds
secondsout=hours*3600;
end
Kindly revert for any queries
Thanks.
part 1: Create Useful Functions. Create the following functions in MATLAB and use the function names...
Assignment: Do this assignment after reading zyBooks Chapter 3. Create the following functions in MATLAB and save them to your directory. You must use the function names provided below! Use the attached test script TestConversions.m to test your functions. kmout = MilesToKm(miles) % converts a value in miles to kilometers JoulesOut = CalToJoules(DietaryCalories) % converts dietary calories (big calories) to Joules kWhrOut = JoulesToKWHr(joules) % converts Joules to kilowatt hours metersout = FeetToMeters(feet) % converts feet to meters secondsout =...