How to read the specific colums from 12 excel files in a folder and then plot it
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!