hi everyone today I will be showing you how to import Excel data in the MATLAB without writing
any code 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 if you have multiple Excel files that you need to import
but don't want to import each one individually but first let's take a look at the data on learnings
for using in this video here I have data on cars manufactured from 1970 to 1982 with headers and
multiple columns containing details about the cars to import this data let's start by opening
the import tool you can do this by clicking the import data icon under the Home tab and navigating
to the excel file that you want to import but I like to simply double-click on the file from the
current folder directory with the import tool open you can select data by left clicking and
dragging the data that you want you can see that the range field is updated as I do this but I'm
just going to use the initial selection range great about this is that MATLAB automatically
leaves out the headers in the selection but we can see that the columns will be named when we
import the data with our data selected we simply press the green checkmark to import it will then
get this notification saying that the data was imported properly by default data is imported as
a table if you would like to change this go to the drop-down under output type column vectors
are probably what most of you are used to so let's import this as well this time in the
notification we can see that multiple variables are imported this is because when we import the
data as column vectors each column data is stored into an individual variable some of you might be
wondering why some of the cells are highlighted this tan color instead of blue this is because
they are classified as unimportant Elle's in this case it's because there is no data in the cells
up here under the unemployed will sell section we can see that the cells will be imported as
a man or not a number Nan's or Matt lives way of representing values that are not real or complex
numbers you can change these cells to import as a number if you would like but we are not going
to need to do that in this video switching back to MATLAB we can see the data that we imported
but 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 to import each set of data to solve this
we can generate a function to import each data set for us to do this let's go back
to the import tool right under the green check mark where we imported the data we click the
drop down from this you can see that we can also generate scripts and live scripts so let's select
the generate function option this will pull up a new function in MATLAB in the function
we can see all the code that we were saved from writing I enjoy using this feature because all
the code is commented which makes it really easy to edit and incorporate into any other
scripts but I'm writing if we want to use this function we just have to save the function and
then call it using the file we want to import I'm going to import a different set of car data using
the function I just generated with that you know everything you need to know to get started with
the import tool what's the data imported I'm going to show you some visualization you can
do with it and once again without writing any code today we want to determine if there is any
correlation between horsepower and mpg we can do this by creating a scatterplot to do this I will
select the two variables go to the plot tab and then select scatter plot we can even try other
plots to see if another one makes more sense with a click of a button we can even try creating more
interesting cloth such as a box plot to show the variants of mpg by country but if you really want
to impress your friends try creating a word cloud to visually show the manufacturers in the data set
the bigger the name the more of that manufacturers cars that were in this data set what's great about
making plots this way is that the code for the plot is shown in the command window so you can
incorporate into your scripts with no problem with that that completes my video for more information
regarding content in this video check out the links in the description thanks for watching