From the course: MATLAB 2018 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Examine values using the is statements

Examine values using the is statements - MATLAB Tutorial

From the course: MATLAB 2018 Essential Training

Start my 1-month free trial

Examine values using the is statements

- [Instructor] Writing MATLAB scripts requires you to check the data your code creates and receives as input. The MATLAB language includes a number of functions you can use to ensure the data that you're working with is of the type you expect. I'll show you how to use those functions in this movie, and I'll start with an overview in PowerPoint and then I'll switch to MATLAB. These are called the is family of functions, and you'll see why very quickly. isequal returns true if two statements are equal. In other words, if you have the same word or the same number, then that would be an example where isequal would return a logical one or true. If they were different, it would return a logical zero or false. ischar, or iscar, as some people pronounce it, returns true if a value is a character. iskeyword takes a slightly different approach, and it returns true if a value is a reserved word. In other words, there are certain function names and other reserved words in MATLAB that you really…

Contents