Exporting animation figure mat lab to power point.
17 次查看(过去 30 天)
显示 更早的评论
I Have this animation figure in matlab. Can anyone help me how to easly export it to my powerpoint presentation where I can show my animation in the slide.
clear;close all;clc
slope_times = [0, 10, 20, 50];
slope = [1, 3, 5, 7]; %you need to recheck the initial slope
x = 0:10:100;
times = linspace(slope_times(1), slope_times(end));
m = interp1(slope_times, slope, times);
for k = 1 : length(times)
y = m(k) * x;
plot(x, y);
title( sprintf('t = %.1f', times(k)) );
hold all
pause( 0.5 );
end
hold off
Thanks
0 个评论
回答(1 个)
KSSV
2016-12-21
YOu make your animation into a .gif file and import it into power point.
clc; clear all ;
clear;close all;clc
slope_times = [0, 10, 20, 50];
slope = [1, 3, 5, 7]; %you need to recheck the initial slope
x = 0:10:100;
times = linspace(slope_times(1), slope_times(end));
m = interp1(slope_times, slope, times);
figure(1)
filename = 'test.gif';
for k = 1 : length(times)
y = m(k) * x;
plot(x, y);
title( sprintf('t = %.1f', times(k)) );
hold all
pause( 0.5 );
frame = getframe(1);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
if k == 1;
imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
else
imwrite(imind,cm,filename,'gif','WriteMode','append');
end
end
hold off
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!