Carnot engine is considered the most efficient heat engine.When operated between two temperatures T1 and T2, the efficiency is given by: efficiency=1-T1/T2 where T1<=T2 and both are in kelvin. Given the temperatures in degree celsius, find the efficiency.
I think their is a problem with the test case 3.
I guess you're right
T1 and T2 do not necessarily imply x(1) and x(2).the higher temp. is always in den.
I have used Max(x) and Min(x) ... then also the test case does not satisfy...
The problem is the isequal() without any tolerance...
The conversion between Kelvin and Celsius is 273.15, not 273.
Sigh...a little challenge with tolerance? :)
haha~just finish it as fast as I can, didn't have time realizing how stupid this answer is. I saw your answer by the way, it just avoid the tolerance issue with avoiding obvious subtract, brilliant move!
5703 Solvers
All your base are belong to us
425 Solvers
261 Solvers
Matlab Basics - Pick out parts of a vector
148 Solvers
481 Solvers