If/elseif statement block
7 次查看(过去 30 天)
显示 更早的评论
I'm having a little trouble with coming up with the block for... I'm asking the use to input the temperature unit, and I only want it to accept the characters C,F,K,R. The program then has to check if each unit is valid, meaning it has to be upper case (the above letters). Can anyone help me with the if/else statement that I would use for this.
0 个评论
回答(1 个)
Image Analyst
2012-2-12
I thought you agreed to my answer http://www.mathworks.com/matlabcentral/answers/28780-inputting-units where I said to just do the conversion to upper case yourself and don't worry the user about it. You accepted it as the answer already. Why the change of mind back to a user-unfriendly way of doing it?
3 个评论
Image Analyst
2012-2-12
OK, that's the way it should be. Etiquette calls for people to say in advance when a question is a homework assignment.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!