Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • OneDrive
      • Google Docs
      • Google Sheets
      • Google Drive
    • Email
      • Gmail
      • Outlook
      • Emal Etiquette
    • Office Etiquette
    • Productivity
    Inside The Web
    Home»Office»Excel»How to Load and Read Excel Data into MATLAB

    How to Load and Read Excel Data into MATLAB

    Asmi DhakalBy Asmi DhakalJune 18, 2023 Excel 3 Mins Read

    MATLAB is mostly a computing platform popular among engineers and data scientists. Most of MATLAB uses surround analyzing and visualizing a data set making it an amazing tool to analyze your Excel spreadsheet.

    MATLAB is flexible when it comes to importing data; therefore, you can easily import an Excel spreadsheet into the MATLAB program.

    How to Import Excel into MATLAB?

    The MATLAB interface is pretty simple and beginner-friendly. This makes navigating the import option pretty straightforward. Additionally, if you often find yourself in need of importing Excel into MATLAB, the program has the option for you to create a code the next time you wish to import a .xlsx file.

    While importing your data, you will get the option to select an Output Type. You can either import the data as a Table, Column Vector, Numeric Matrix, String Array, or Cell Array. Similarly, MATLAB also gives you the option to choose what you wish to do with cells that are deemed uncomfortable. Such cells are usually the ones that are empty.

    From the Home Tab

    The easiest way to import any file, including an Excel file, is from the Home tab of MATLAB. 

    1. Open MATLAB and head to the Home tab.
    2. Look for and select Import Data from the VARIABLE section.
      Import Data MATLAB
    3. Locate and open your Excel file from File Explorer.
    4. From the IMPORT tab, select the data you wish to import. You can either select and drag your cursor to make the selection to set the range next to the Range option in the SELECTION section.
      Selection in MATLAB
    5. Under Output Type in the IMPORTED DATA section, select how you wish to import your data as.
      Output Type MATLAB
    6. Choose how you wish empty cells to be exported in the UNIMPORTABLE CELLS section.
      Configure unimportable cells
    7. After you make the configurations, select Import Selection in the IMPORT tab.
      Import Selection MATLAB
    8. Head back to the previous window and locate your data under Workspace.
      View Imported Excel Sheet from MATLAB
    9. Double-click on your data.

    Create a Function to Import Excel Sheet to MATLAB

    If you frequently import files from Excel to MATLAB, you may find the method we discussed above pretty long and tedious. You can instead let MATLAB automate a function after you make your first import and then save it to use in the future. This will save you plenty of time you would otherwise be spending in importing your data.

    1. Use the Home tab to import your data.
    2. After configuring the selection and the output type, select the fly-out menu under Import Selection.
    3. Choose Generate Function.
      Generate Import Function MATLAB
    4. Save the function from the FILE section in the Editor tab.
      Save Code in MATLAB
    5. To import a sheet in the future, set up your Current Folder window by entering its path.
      Set Current Folder in MATLAB
    6. Under the Command Window section, enter your command in the following format:
    importfile(‘(filename)’)
    1. Hit Enter.
      importfile code in MATLAB
    2. View your data by double-clicking on it under the Workspace section.
    Advanced Excel
    Asmi Dhakal

      Asmi is a content writer specializing in MS Office. She loves writing Excel-related content to assist other users to learn their way around the program. She started using Excel when she first entered the industry as a marketing intern. Soon, she realized that learning the often-overlooked spreadsheet program was no piece of cake. In her articles, she attempts to brief out complex topics to help beginner to intermediate-level Excel users. Asmi uses Excel for everything, including creating a grocery list to managing her personal finance. She’s a bit dramatic when it comes to the Flash Fill feature; so much so that could write a eulogy out of it. When she’s not working, you’ll find her learning a new recipe, or cleaning up her mess (out of the failed recipe).

      Related Posts

      Excel By Nisha Gurung

      How to Compare Two Columns in Excel Using VLOOKUP

      Excel By Nisha Gurung

      How to Share Excel Files with Multiple Users

      Excel By Nisha Gurung

      How to Filter Based on a List in Excel

      Add A Comment
      Table of ContentsToggle Table of ContentToggle
      • How to Import Excel into MATLAB?
        • From the Home Tab
        • Create a Function to Import Excel Sheet to MATLAB
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.