Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The part of this I can\'t complete is converting the input string of the tempera

ID: 3796693 • Letter: T

Question

The part of this I can't complete is converting the input string of the temperature to a numeric value that can be used by the tF method. This is the work I have so far.

function [tF] = convertC(tC)

calctC = input('Enter Temperature ', 's');

convert = datenum(calctC,'s');

age = datestr(now-convert ,'s');

tC = age(end, end);

switch nargin

case 0

error('No initial temperature defined')

end

tF = ((9/5*tC)) + 32;

fprintf('%2.2f degrees F/n');

end

Write a function to convert C to Fin degrees. Test the function for 0C, 100C. Include an error message into function if a temperature is not inputted.

Explanation / Answer

%function to convert celcius to degrees function [tF] = convertC(tC) if isempty(tC) %check for empty temperature error('No initial temperature defined') end tF = ((9/5*tC)) + 32; end calctC = input('Enter Temperature') %enter temperature in celcius y = convertC(calctC ) %call convert function sprintf('%2.2f degrees F/n',y) %print the converted farenhiet value

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote