content = dir('*.xlsx');
content([content.isdir]) = [];
files = cell(size(content));
for fi = 1:numel(files)
[~, files{fi}] = fileparts(content(fi).name);
end
for fn=1:numel(files)
ff= xlsread(strcat(files{fn},'.xlsx'));
t = ff(:,1);
motiont=ff;
maxlim=max(max(motiont(:,2:7)))
minlim=min(min(motiont(:,2:7)))
directory=pwd
pptpop(motiont,minlim,maxlim,files{fn})
end
function pptpop(motion6t,minlim, maxlim,filename)
import mlreportgen.ppt.*;
images = {};
slidesFile = 'Report.pptx';
pre = Presentation(slidesFile);
slide = add(pre, 'Title Slide');
replace(slide, 'Title', 'ttt');
replace(slide, 'Subtitle', '111');
slide = add(pre, 'Title and Content');
replace(slide, 'Title', 'Contents');
slide = add(pre, 'Title and Content');
replace(slide, 'Title', 'US Census data from 1900 to 2000');
myfigure(motion6t,minlim, maxlim,filename)
img = printPlot('plot1');
replace(slide, 'Content', Picture(img));
images = [images {img}];
close(pre);
if ispc
winopen(pre.OutputPath);
end
for i = 1:length(images)
delete(images{i});
end
exportgraphics(gcf, imgname)
delete(gcf);
function imgname = printPlot(name)
import mlreportgen.ppt.*;
if ~ispc
imgtype = '-dpng';
imgname= [name '.png'];
else
imgtype = '-dmeta';
imgname = [name '.emf'];
end
end
function myfigure(motion6t,minlim, maxlim,filename)
f = figure('visible', 'off');
fsize=12;
lw= 0.7
subplot(611);
plot(motion6t(:,1),motion6t(:,2),'LineWidth',lw)
grid;
ylabel('Tx (mm)');
title(filename);
ax1=gca;
ax1.FontSize=fsize;
subplot(612);
plot(motion6t(:,1),motion6t(:,3),'LineWidth',lw);
grid;
ylabel('Ty (mm)');
ax1=gca;
ax1.FontSize=fsize;
subplot(613);
plot(motion6t(:,1),motion6t(:,4),'LineWidth',lw);
grid;
ylabel('Tz (mm)');
ax1=gca;
ax1.FontSize=fsize;
subplot(614);
plot(motion6t(:,1),motion6t(:,5),'LineWidth',lw);
grid;
ylabel('Rx (deg)');
ax1=gca;
ax1.FontSize=fsize;
subplot(615);
plot(motion6t(:,1),motion6t(:,6),'LineWidth',lw);
grid;
ylabel('Ry (deg)');
ax1=gca;
ax1.FontSize=fsize;
subplot(616);
plot(motion6t(:,1),motion6t(:,7),'LineWidth',lw);
grid;
ylabel('Rz (deg)');
xlabel('Time (sec)');
ax1=gca;
ax1.FontSize=fsize;
for kk =1:6
subplot(6,1,kk)
ylim([minlim, maxlim]);
end
set(gcf, 'Position', [100, 100, 1000, 800])
end
end