Borrar filtros
Borrar filtros

xlsread unable to open file

24 visualizaciones (últimos 30 días)
Anthony Voccia
Anthony Voccia el 20 de Sept. de 2018
Comentada: Anthony Voccia el 20 de Sept. de 2018
I have been messing with this for a while now but have no clue what to change. The error is in line 4, any ideas?

Respuesta aceptada

Stephan
Stephan el 20 de Sept. de 2018
Editada: Stephan el 20 de Sept. de 2018
Hi,
path = 'C:\Users\Stephan\Desktop';
filename = 'test.xlsx';
fullpath = [path, '\', filename];
data = xlsread(fullpath,'A1:B2');
is one possibility of solving this problem.
Also join would work:
path = "C:\Users\Stephan\Desktop";
filename = "test.xlsx";
fullpath = join([path, filename],"\");
data = xlsread(fullpath,'A1:B2');
Note that double quotes are used now.
Best regards
Stephan
  1 comentario
Anthony Voccia
Anthony Voccia el 20 de Sept. de 2018
Thanks! I used the first one and modified data= and elong= which made them both work.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by