From plot to video

2 ビュー (過去 30 日間)
SYML2nd
SYML2nd 2021 年 6 月 13 日
回答済み: Image Analyst 2021 年 6 月 13 日
Hi all,
I have done this code and I obtain a plot of graphs where every graph represent the result at a different second. How can I translate this in a video where the graphs appear subsequently one by one? is it possible to obtain it in a video format?
clear
T0=293
s=1
alfa=0.005
for a=1:1:21
t=0:1:20
for b=1:1:21
x=0:0.05:1
for n=1:1:100
T=(2.*T0./pi).*((1-((-1).^n))./n).*exp(-((n.*pi./s).^2).*alfa.*t(:,a)).*(sin(pi.*n.*x(:,b)./s))
Tn1(:,n)=T
Tn=sum(Tn1)
end
Tb(:,b)=Tn
end
Tab(:,a)=Tb
end
plot(x,Tab)

回答 (2 件)

Walter Roberson
Walter Roberson 2021 年 6 月 13 日
  2 件のコメント
SYML2nd
SYML2nd 2021 年 6 月 13 日
編集済み: SYML2nd 2021 年 6 月 13 日
I tried to place this code at the end of my code, but nothing works.
F = getframe;
figure
imshow(F.cdata)
Walter Roberson
Walter Roberson 2021 年 6 月 13 日
編集済み: Walter Roberson 2021 年 6 月 13 日
fig = figure();
ax = axes(fig);
T0 = 293;
s = 1;
alfa = 0.005;
t = 0:1:20;
x = 0:0.05:1;
for a = 1:1:21
for b = 1:1:21
for n = 1:1:100
T = (2.*T0./pi).*((1-((-1).^n))./n).*exp(-((n.*pi./s).^2).*alfa.*t(:,a)).*(sin(pi.*n.*x(:,b)./s));
Tn1(:,n) = T;
end
Tn = sum(Tn1);
Tb(:,b) = Tn;
end
Tab(:,a) = Tb;
end
plot(ax, x,Tab)
F = getframe(ax);
exportgraphics(ax, 'test_export.png');
figure();
imshow(F.cdata)
At the moment I do not know why only the inside of the axes is being captured.
figure();
imshow('test_export.png')
but exportgraphics() gets it all.

サインインしてコメントする。


Image Analyst
Image Analyst 2021 年 6 月 13 日
See attached demo and adapt as needed.

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by