xlsread unable to open file

5 ビュー (過去 30 日間)
Anthony Voccia
Anthony Voccia 2018 年 9 月 20 日
コメント済み: Anthony Voccia 2018 年 9 月 20 日
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 Center および File ExchangeApp Building についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by