Problem 44434. Writing Error Messages
Well written functions check inputs to make sure the input is valid. The function ErrorCheck takes three arguments:
- a - a scalar value
- b - either a string, or a character array
- c - a square matrix (numerical array)
If the input is anything other then this, throw the error message
'Cody demonstration error'
If the input is good, simply return 23.
Solution Stats
Problem Comments
- 
		2 Comments
Clarification: For b, with "a string" it seems you accept both string arrays and char arrays. For c, with "matrix" it seems you require a numeric array — this is different from MATLAB's definition of a "matrix".
Thank you David Verrelli. I have modified the problem description to try to reflect that.
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
- 
         How to find the position of an element in a vector without using the find function 2775 Solvers 
- 
         Matrix with different incremental runs 556 Solvers 
- 
         
         355 Solvers 
- 
         Deleting an element in a matrix 480 Solvers 
- 
         
         664 Solvers 
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!