フィルターのクリア

Exporting animation figure mat lab to power point.

15 ビュー (過去 30 日間)
friet
friet 2016 年 12 月 21 日
回答済み: KSSV 2016 年 12 月 21 日
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

回答 (1 件)

KSSV
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

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by