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 CenterMATLAB Answers에서 Interactive 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