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.

Define ranges of values

Define ranges of values - MATLAB Tutorial

From the course: MATLAB 2018 Essential Training

Start my 1-month free trial

Define ranges of values

- [Instructor] Many of the calculations you perform in MATLAB will use single values. However, there will be times when you want to define a range of values, such as the odd numbers from 11 to 19, or the powers of 10. In this movie, I will show you how to create those ranges in your script. I have started MATLAB, and I'm using a blank command window. Let's say that you want to create a range that just goes up by one, which is the standard increment for this type of operation. I'll assign them to variable A, and I'll say it equals three colon seven, and when I press enter, you'll see that MATLAB creates the values three, four, five, six and seven, and if you're using the default installation for MATLAB, then you probably have the workspace at the bottom left corner and you can see that variable A is a one by five, which means a one row, five column array. And the values are three, four, five, six, and seven enclosed in square brackets. That's how you go up by one. You can also set a…

Contents