Trying to open/read a .xlsx file in MATLAB

63 visualizaciones (últimos 30 días)
Athena Harris
Athena Harris el 4 de En. de 2022
Comentada: Star Strider el 4 de En. de 2022
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 comentario
Mathieu NOE
Mathieu NOE el 4 de En. de 2022
hello
are you sure the filename syntax is correct (blanks ? )
'Player A Statistics.xlsx' or 'PlayerAStatistics.xlsx' ??

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 4 de En. de 2022
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.
.
  2 comentarios
Athena Harris
Athena Harris el 4 de En. de 2022
Thank you for the information, it's now working as desired
Star Strider
Star Strider el 4 de En. de 2022
As always, my pleasure!
.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by