I have multiple csv files that need to be imported to later extract certain columns to write new files. However the code below doesnt return the column I need (column 1) I need the code to create a matrix "Time" for every file

1 view (last 30 days)
folder= 'H:\Matlab\CSV\Processed_csv_Type3';
d = dir([folder '\*.csv']);
for i=1:length(d)
m{i}=csvread(d(i).name); % put into cell array
Time{i} =m{i(:,1)};
end

Accepted Answer

KSSV
KSSV on 2 Dec 2016
folder= 'H:\Matlab\CSV\Processed_csv_Type3';
d = dir([folder '\*.csv']);
for i=1:length(d)
m{i}=csvread(d(i).name); % put into cell array
Time{i} =m{i}(:,1);
end

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!