フィルターのクリア

Basic Excel Import Error

1 回表示 (過去 30 日間)
xander fong
xander fong 2015 年 7 月 15 日
回答済み: Geoff Hayes 2015 年 7 月 15 日
Hello, I'm new to Matlab and am trying to create the beginning of a script that lists all *.XYZ files from excel and then stores their file contents. The beginning of the script is:
dirName = ':/Users/xanderfong/Documents/EOD’; %choose directory
files = dir('*.xlsx'); % list all *.xyz files
files = {files.name}'; % transpose file names
data = cell(numel(files),1); % store file contents
for i=1:numel(files)
% load file into 'data' variable
data{i} = importfile(files{i},'Test');
end
However, it returns
dirName = ':/Users/xanderfong/Documents/EOD’;
|
Error: String is not terminated properly."

採用された回答

Geoff Hayes
Geoff Hayes 2015 年 7 月 15 日
xander - the final quote on your dirName string is not the same as your starting quote. (It is a ’ and not a '.) Try changing this to
dirName = ':/Users/xanderfong/Documents/EOD';
You may need to remove the colon too.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by