From the course: MATLAB Essential Training
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Load values from a file into a script - MATLAB Tutorial
From the course: MATLAB Essential Training
Load values from a file into a script
- [Instructor] One of the most common data tasks that you'll perform in MATLAB is to read data in from an external file. And in this movie, I will show you how to do that. I have created a blank command window in MATLAB, and I'll start by defining a variable, and then exporting that data to an external file. So I'll start with a variable called mat1 equal. I'll make it two rows. The first will be the odd numbers from one to seven, and the second row will be the even numbers from two to eight. So after the left square bracket, a left parenthesis, and then one will be the first number, colon two, which is my step value, and colon seven. So that'll be the end value. Then semicolon to move to the next row. And that definition will be the range starting at two, colon, step two, colon and a maximum value of eight. Right parenthesis and right square bracket to close out. And Enter, great, there's my matrix. Now, I will save this…