if statement different answer when input variable vs number
显示 更早的评论
I do not understand why the if statement here produces different results. In one statement, I use the variable names, and in the other I substitute the variable values for the names. Each if statement should yield 'true' because no values are changed.
>> time_end
time_end =
30.0000
>> time_met_end
time_met_end =
30
>> if time_end>time_met_end
disp('true')
end
true
>> if 30.0000 > 30
disp('true')
end
>>
>>
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!