fig2cmd

fig-file to command-strings converter
2K Downloads
Aktualisiert 17. Jul 2006

Keine Lizenz

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.

Zitieren als

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

Kompatibilität der MATLAB-Version
Erstellt mit R2006a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0

description typos fixed