xlsread unable to open file

24 次查看(过去 30 天)
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?

采纳的回答

Stephan
Stephan 2018-9-20
编辑:Stephan 2018-9-20
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 个评论
Anthony Voccia
Anthony Voccia 2018-9-20
Thanks! I used the first one and modified data= and elong= which made them both work.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by