I am constantly getting this error 'All 'cdata' fields in FRAMES must be the same size.'

13 ビュー (過去 30 日間)
Saugat Shrestha
Saugat Shrestha 2020 年 8 月 4 日
回答済み: Walter Roberson 2020 年 8 月 4 日
I am running the attached code. I am having no problmes executing the code but when I try to make a final animation I get an error. Can you please help me. Your help will be deeply appreciated.
Thank You

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 8 月 4 日
fig = figure('position',[100 100 850 600]);
fig is created with a particular fixed size and position.
for p=1:len
and multiple times,
myMovie(p)=getframe(gcf);
it is captured,
closereq
and right after the figure is captured, it is deleted.
Then the next iteration of the loop is started, and has plotting commands, so a new figure is created automatically. But the automatically created figure has the default figure size and position, not the hard-coded [100 100 850 600] size and position. So when you capture it, it is not going to be the same size as the figure from the first iteration.

カテゴリ

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