How to I load data to my code?

I have a data set that was created in an excel sheet and then downloaded to my computer. I am trying to analyze that data using MATLAB but I am not sure how to open the data in MATLAB.

 Accepted Answer

It depends on the format of the data file. Some things to try
data = readmatrix(fileName);
data = readcell(fileName);
data = importdata(fileName);
[data, strings, raw] = xlsread(fileName);

2 Comments

I tried all of these options but it just says invalid use of operator.
I figured it out, thank you!

Sign in to comment.

More Answers (0)

Asked:

on 27 Jul 2022

Commented:

on 27 Jul 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!