フィルターのクリア

unrecognized input argument moviegui MATLAB R2015b

2 ビュー (過去 30 日間)
Meva
Meva 2016 年 1 月 28 日
編集済み: Jan 2016 年 1 月 28 日
Hello, I tried this code:
h=figure;
movegui(h, 'onscreen');
rect = get(h,'Position');
rect(1:2) = [0 0];
vidObj = VideoWriter('H1,H2.avi');
vidObj.Quality = 100;
open(vidObj);
for it=1:Nt
t=it*dt;
H1(1) = 1;
figure(1)
h=plot(x,H1,'--',x, H2,':','lineWidth',2);
title({['H1 and H2 in the wake region'];['time(\itt) = ',num2str(dt*it)]})
xlabel('Spatial coordinate (x) \rightarrow')
ylabel('(H1), (H2) \rightarrow')
legend('H1', 'H2')
movegui(h, 'onscreen');
hold all;
if ~mod(t,0.1)
saveas(gcf, ['t=',num2str(t),'.png'])
end
for i=2:Nx
H1(i)=...
end
end
close(vidObj);
Why I cannot see any movie and I get the error message above?
  1 件のコメント
Jan
Jan 2016 年 1 月 28 日
Post the complete error message, such that we do not have to guess which of the 2 movegui commands fails.

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

採用された回答

Jan
Jan 2016 年 1 月 28 日
編集済み: Jan 2016 年 1 月 28 日
movegui(h, pos) requires the first input to be the handle of a figure. But inside the loop h is the handle of the line object created by plot().
Because the figure does not change its size inside the loop, you can omit the movegui command there.
Some improvements:
hFig = figure; % a better name than simply "h"
...
figure(hFig); % Not hardcoded [1]
...
movegui(hFig, 'onscreen'); % Or omit this line!

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by