Chapter 1 EX: 2, variables, inputs

4 Ansichten (letzte 30 Tage)
Hannah King
Hannah King am 27 Jan. 2020
Beantwortet: Hannah King am 27 Jan. 2020
Hello,
I am using MatLab grader and I'm asked to convert from F to C I know the conversion would be
  • (5/9) * (ftemp-32)
I know this is simple, but I have had over 30 attempts. I have tried using fprintf and disp to display the conversion. Nothing is working. It says the error is from F to C. I tried fixing that everyway I know how.I'm not sure what else I can do.
The problem is: Given Variable, ftemp as your input, convert to celsuis and store the result as ctemp
Examples:
input ftemp= 32
output ctemp = 0
  2 Kommentare
Geoff Hayes
Geoff Hayes am 27 Jan. 2020
Hannah - what is the code that you have written? Have you created a function to do this conversion?
Hannah King
Hannah King am 27 Jan. 2020
I have writted many codes that look along the lines of this:
The converision is below under ctemp
ftemp = input
ctemp = (5/9) * (ftemp-32)
disp ctemp

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Hannah King
Hannah King am 27 Jan. 2020
I just over thought it... The real solutions is this..
function ctemp = FtoC(ftemp)
ctemp = (5/9) * (ftemp - 32)
end

Weitere Antworten (0)

Kategorien

Mehr zu Debugging and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by