Effacer les filtres
Effacer les filtres

Exporting animation figure mat lab to power point.

15 vues (au cours des 30 derniers jours)
friet
friet le 21 Déc 2016
Réponse apportée : KSSV le 21 Déc 2016
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

Réponses (1)

KSSV
KSSV le 21 Déc 2016
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

Catégories

En savoir plus sur Animation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by