![]() To do this let’s go back to the Import tool. Switching back to MATLAB we can see the data that we imported.īut what if you have multiple Excel files of data such as lab results from several different tests but you don’t want to open up the Import tool each time to import each set of data? To solve this, we can generate a function to import each data set for us. You could change these cells to import as number if you would like but we’re not going to need to do that in this video. NaNs are MATLAB’s way of representing values that are not real or complex numbers. Up here under the unimportable cells section we can see that these cells will be imported as a NaN or Not a Number. In this case it’s because there is no data in the cell. This is because they are classified as an unimportable cell. Some of you might be wondering why some of the cells are highlighted this tan color instead of blue. This is because when we import the data as column vectors each column of data is stored into an individual variable. This time in the notification we can see that multiple variables are imported. Column vectors are probably what most of you are used to so let's import this as well. ![]() If you would like to change this, go to the drop-down under output type. We’ll then get this notification saying the data was imported properly. With our data selected, we simply press this green check mark to import it. ![]() But we can see that the columns will be named when we import the data. What’s great about this is that MATLAB automatically leaves out the headers in the selection. But I’m just going to use the initial selection range. You can see that the range field is updated as I do this. With the Import tool open you can select data by left clicking and dragging the data that you want. But I like to simply double-click on the file from the current folder directory. You can do this by clicking the Import Data icon under the Home tab and navigating to the Excel file you that want to import. To import this data let’s start by opening the import tool. Here I have data on cars manufactured from 1970 to 1982 with headers and multiple columns containing details about the cars. But first, let’s look at the data I’m going to be using in this video. This is very useful when you have to do analysis on data but don’t want to spend the time learning the functions to import that data or if you have multiple Excel files you need to import but don’t want to import each one individually. Today I will be showing you how to import Excel data into MATLAB without writing any code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |