I use Matlab2018b on iOS. csvread does not work. file not found
Show older comments
i use this code
validdatatypes = {'.csv'};
strPath = dir('/Users/***/mess1600');
lPath = struct2cell(strPath)';
lPath = lPath(cell2mat(lPath(:,strcmp('isdir',fieldnames(strPath)))) == 0 & contains(lPath(:,1),validdatatypes),:);
lPath = cellfun(@(a,b) [b '\' a],lPath(:,1),lPath(:,2),'uniformoutput',0);
format long;
data = cell(numel(lPath),1);
for n = 1:numel(lPath)
data{n} = csvread(lPath{n},3,0);
end
error is:
Error using csvread (line 35)
File not found.
Error in export (line 10)
data{n} = csvread(lPath{n},3,0);
anybody got an idea? it worked on windows
2 Comments
madhan ravi
on 15 Dec 2018
means the file does not exist in your working directory
Answers (1)
madhan ravi
on 15 Dec 2018
Edited: madhan ravi
on 15 Dec 2018
0 votes
Processing sequence of files (use xlsread() or readtable() to read the file)
8 Comments
benn
on 15 Dec 2018
madhan ravi
on 15 Dec 2018
lpath % paste the results here
benn
on 15 Dec 2018
madhan ravi
on 15 Dec 2018
use xlsread() or readtable() ??
benn
on 15 Dec 2018
madhan ravi
on 15 Dec 2018
i tried something else. i guess i know what the mistake is, but cant handle it. the pathnames in lPath are missing this: '..' around them, thats why csvread cant open them. how to i add those somehow?
madhan ravi
on 15 Dec 2018
doc sprintf
doc strcat
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!