How would I be able to check for the correct input value for a function, say I'm expecting a number but instead they put in a character?

 채택된 답변

Mischa Kim
Mischa Kim 2014년 3월 1일
편집: Mischa Kim 2014년 3월 1일

0 개 추천

Sarah, use the isnumeric command (see example here). Or use validateattributes as a more advanced concept.

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 3월 1일
편집: Azzi Abdelmalek 2014년 3월 1일

0 개 추천

Use class function
s='err'
class(s)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2014년 3월 1일

편집:

2014년 3월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by