matlab hgsave and hgload 存取句柄图形

本文详细介绍了MATLAB中用于保存和加载句柄图形对象的hgsave和hgload函数的用法。hgsave可以将当前图形或指定句柄的图形保存到文件,而hgload则可以从文件中加载图形对象及其子对象。文章提到了保存默认工具栏和菜单的注意事项,以及如何处理非序列化对象。

hgsave


Save Handle Graphics object hierarchy to file


Syntax


hgsave('filename')
hgsave(h,'filename')
hgsave(...,'all')
hgsave(...,'-v6')
hgsave(...,'-v7.3')

Description


hgsave('filename') saves the current figure to a file named filename.

hgsave(h,'filename') saves the objects identified by the array of handles h to a file named filename. If you do not specify an extension for filename, then the extension .fig is appended. If h is a vector, none of the handles in h may be ancestors or descendents of any other handles in h.

hgsave(...,'all') overrides the default behavior, which does not save nonserializable objects. Nonserializable objects include the default toolbars and default menus. This allows revisions of the default menus and toolbars to occur without affecting existing FIG-files and also reduces the size of FIG-files. Passing the string all to hgsave ensures that nonserializable objects are also saved. This option is obsolete and will be removed in a future release.





hgload


Load Handle Graphics object hierarchy from file



Syntax


h = hgload('filename')
[h,old_prop_values] = hgload(...,property_structure)
hgload(...,'all')

Description


h = hgload('filename') loads Handle Graphics objects and its children (if any) from the FIG-file specified by filename and returns handles to the top-level objects. If filename contains no extension, then the MATLAB software adds the .fig extension.

[h,old_prop_values] = hgload(...,property_structure) overrides the properties on the top-level objects stored in the FIG-file with the values in property_structure, and returns their previous values in old_prop_values.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值