fig2cmd

バージョン 1.0.0.0 (3.12 KB) 作成者: Ofek Shilon
fig-file to command-strings converter
ダウンロード: 2K
更新 2006/7/17

ライセンスがありません

command_strings = fig2cmd(figfile,varargin)

This routine is meant for users (like myself) who wish to enjoy the graphical design capabilities of GUIDE, but avoid the large amount of code it generates. The routine takes the figfile and extracts the gui objects (figure, axes, uicontrol etc.) and their properties (position, string, tag, etc.) to a cell arr of valid command strings. These strings can then be pasted in code or even sent to eval.

The routine wasn't tested on all possible gui-objects and configurations, but the basic apparatus should apply to all objects, with little or no adaptation. Please let me know if any gui-objects or props causes problems : ofek@REMOVETHISsimbionix.com

Several modes of operation are available:
cs = fig2cmd(figfile, proplist) ,
generages the commands reproducing the GUI, with specified props stated explicitly.

cs = fig2cmd(figfile, 'nondefault', ... )
generates commands specifying only nondefault properties among the given ones.

cs = fig2cmd((figfile, 'exclude',...)
generates commands specifying all properties (optionaly 'nondefault') excluding those given as arguments.

There is a hard-coded default property list and basic exclude properties.
You can modify them manually at the beginning of the m-file.

Example :

cs = fig2cmd('myfig.fig', 'units','position')

may produce output similar to -

cs =
'figure('units','characters','position',[112 31.38462 49 25.15385])'
'uicontrol('units','characters','position',[6.2 7.23077 33.8 1.30769])'
'axes('units','characters','position',[5.6 3 36.4 3.84615])'


cs = fig2cmd('myfig','nondefault','exclude', 'CData')

would generate GUI commands with comprehensive nondefault property list as arguments, excluding the color data of the gui objects.

引用

Ofek Shilon (2024). fig2cmd (https://www.mathworks.com/matlabcentral/fileexchange/11159-fig2cmd), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2006a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

description typos fixed