How to load Excel .xlsx and .mat files into Matlab?

7 次查看(过去 30 天)
I was able to import a .xlsx file and a .mat file containing data that I need to use for my code. However when I use "load FileName" I get an error that says "unable to read file. No such file or directory." Please let me know how to do this.
  1 个评论
Sindar
Sindar 2020-4-25
Are you in the same folder as the file? Have you double-checked the spelling and extension (I can't tell you how many times I've been just slightly off).

请先登录,再进行评论。

采纳的回答

per isakson
per isakson 2020-4-25
编辑:per isakson 2020-4-25
The function, load(), cannot read excel-files.
"when I use "load FileName" I get an error" FileName is that the name of a mat-file? Or is FileName the name of a variable, the value of which is the name of a mat-file?
If FileName is the the name of a mat-file
load FileName
should work
If FileName is the name of a variable, the value of which is the name of a mat-file
load( FileName )
should work
See load()
  1 个评论
Josh Belandres
Josh Belandres 2020-4-25
Yes, I needed to use the load() function when reading mat. file and the xlsread function when reading excel files.
However to fix the errors I put my downloaded data into a new folder within the matlab folder, restarted matlab and then was able to load the data from the workspace.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by