For Loop only showing data for last file within Array
Show older comments
I am trying to create a script that will load multiple xlsx files into one variable. When I run the code, I am able to see the correct number of files being processed however the variable I created to store files only shows the last files processed in the loop. *** I'm a beginner*** please let me know what I need to do so that the variable I created to store the files ( data_in) will no longer read as a 1x73 double rather a 3x73 double.
clear all; clc
[file_list, path_n] = uigetfile('.xlsx', 'Grab the files you want to process', 'MultiSelect', 'on');
if iscell(file_list) == 0
file_list = {file_list};
end
for i = 1:length (file_list)
filename = file_list{i};
data_in = xlsread([path_n filename]);
end
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with MATLAB 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!