M(i)=getframe(gcf) in for loop - Wrong result

2 ビュー (過去 30 日間)
Gennaro Arguzzi
Gennaro Arguzzi 2017 年 6 月 24 日
コメント済み: Gennaro Arguzzi 2017 年 6 月 24 日
Hi everyone. When I run the following code:
f=0.1;
hold on
for k=[0:0.1:1/f]
plotv([real(exp(i*2*pi*f*k)); imag(exp(i*2*pi*f*k))],'-')
x=floor(k*10+1);
M(x)=getframe(gcf);
end
movie(M,1,12);
in the movie there is only a part of circle. Why? I'd like to view complete circle as well as it happens with the only plotv statement.
Thank you very much.

採用された回答

KSSV
KSSV 2017 年 6 月 24 日
編集済み: KSSV 2017 年 6 月 24 日
f=0.1;
hold on
k=0:0.1:1/f ;
for i = 1:length(k)
plotv([real(exp(1i*2*pi*f*k(i))); imag(exp(1i*2*pi*f*k(i)))],'-')
M(i)=getframe(gcf);
end
movie(M,1,12);
  1 件のコメント
Gennaro Arguzzi
Gennaro Arguzzi 2017 年 6 月 24 日
Hi @KSSV, if possible, could you help me to understand what did I do wrong please?

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by