Borrar filtros
Borrar filtros

Exporting animation figure mat lab to power point.

15 visualizaciones (últimos 30 días)
friet
friet el 21 de Dic. de 2016
Respondida: KSSV el 21 de Dic. de 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

Respuestas (1)

KSSV
KSSV el 21 de Dic. de 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

Categorías

Más información sobre Animation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by