Trying to open/read a .xlsx file in MATLAB
63 次查看(过去 30 天)
显示 更早的评论
I'm trying to read an excel file in MATLAB and have the content displayed in the command window my current code is:
PlayerAstatistics = xlsread('Player A Statistics.xlsx');
type PlayerAstatistics
I've replaced 'xlsread' with 'fopen' 'readtable' and 'readmatrix' but I keep getting the same error message:
Error using type
File 'PlayerAstatistics' not found.
The file is shown in both the 'Current folder' and 'Workspace' tabs.
What am I missing or doing wrong to get this error?
1 个评论
Mathieu NOE
2022-1-4
hello
are you sure the filename syntax is correct (blanks ? )
'Player A Statistics.xlsx' or 'PlayerAStatistics.xlsx' ??
采纳的回答
Star Strider
2022-1-4
The type function will display the contents of a file.
The disp function (or simply removing the trailing semicolon from the xlsread call) will likely produce the desired result.
Also, since you are using R2020a, the readmatrix or readtable functions might be more appropriate than xlsread.
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!