Hi,
I am trying to import multiple csv files into Matlab (.csv extension) but I am keep getting an empty structure.
Following online suggestions I used the following line of code:
d = dir('/Users/file_*.clv');
images = arrayfun(@(f) csvread(f.name), dircontent, 'UniformOutput', false);
image = cat(3, images{:});
For some reason seems like Matlab doesn't read the data. I got the following when I checked the size(image). I was expecting a 3D array instead.
Below the code I used with the .csv extension:
d = dir('/Users/file_*.csv');
images = arrayfun(@(f) csvread(f.name), dircontent, 'UniformOutput', false);
image = cat(3, images{:});
I got the following error:
>> mult_csv
Error using csvread (line 35)
File not found.
Error in mult_csv>@(f)csvread(f.name)
Error in mult_csv (line 8)
images = arrayfun(@(f) csvread(f.name), dircontent, 'UniformOutput', false);
Any ideas?
P.S. I attached an example of my csv files.
5 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593385
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593385
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593386
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593386
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593390
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593390
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593404
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593404
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593418
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/412200-unable-to-read-data-with-clv-extension#comment_593418
サインインしてコメントする。