开发者

How can I instantiate one .fig file onto another in MATLAB?

开发者 https://www.devze.com 2023-04-05 03:52 出处:网络
I have a block.fig file which encapsulates some block o开发者_StackOverflow中文版f my graphical user interface (GUI).

I have a block.fig file which encapsulates some block o开发者_StackOverflow中文版f my graphical user interface (GUI). I want to create a full.fig file which uses many instances of that GUI encapsulated in block.fig.

How can I do this?


It's not very clear from you question whether the following applies, but maybe you can adapt this answer to a similar question by picking the components (with FINDOBJ) from the loaded figure and copy/move them to the new figure.

A quick example:

%# create and save block.fig
plot(1:10)
uicontrol('style','text','string','hello')
hgsave('block.fig')
close all

%# create new figure, load saved .fig
hFig = hgload('block.fig');
h = figure;

%# copy the components you want (also think of using the 'Tag' property)
copyobj(findobj(hFig,'type','uicontrol'), h)

%# delete loaded .fig
delete(hFig)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号