How to read the specific colums from 12 excel files in a folder and then plot it
Afficher commentaires plus anciens
Hi,
I want to read column 4 and 10 from each excel file in the folder and then plot column 4 and 10 of each file in one graph. So far I tried the code below but it is only plotting one graph. Any help would be appreciated.
Code:
folder = fullfile('C:','Users','muhammad','Documents','PhD_1stYr','Experiments_2021','performance_110');
files = dir( fullfile(folder, '*.ods') );
% Reading and extracting data from 12 excel files hence plotting
for ii = 1:length(12)
data = readmatrix(fullfile(files(ii).folder,files(ii).name), 'NumHeaderLines', 1)
x= data(:,10)
y=data(:,4)
figure(1)
% Plotting data
plot(x,y,'x','LineWidth',0.5);
hold on
%Spacing and griding
xlim([0.237 5])
ylim([0.237 0.8])
hold on
grid on
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!