If/elseif statement block

조회 수: 7 (최근 30일)
Kevin
Kevin 2012년 2월 12일
편집: Jan 2013년 10월 9일
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.

답변 (1개)

Image Analyst
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
Kevin
Kevin 2012년 2월 12일
Actually nvm, was able to figure this out myself. Thanks for the help though, am using the upper method that you showed me.
Image Analyst
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 CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by