Code covered by the BSD License  

Highlights from
Convert FIG to MATLAB code

5.0

5.0 | 11 ratings Rate this file 47 Downloads (last 30 days) File Size: 8.54 KB File ID: #14340

Convert FIG to MATLAB code

by Thomas Montagnon

 

20 Mar 2007 (Updated 14 Apr 2010)

Generate programmatic GUI MATLAB File from a FIG-File

| Watch this File

File Information
Description

FIG2M - Generate programmatic GUI M-File from a FIG-File

Version : 1.0
Created : 10/05/2006
Modified: 14/04/2010
Author : Thomas Montagnon (The MathWorks France)

>> outputFile = fig2m(guiName,outputDir,syscolorfig,cb_gen);

   guiName -> Name of the Fig-File (absolute or relative path)
   outputDir -> Directory where the generated M-File will be saved
   syscolorfig -> Use system default background color (true or false)
   cb_gen -> Generate callbacks (true or false)
   outputFile -> Name of the generated M-File

>> fig2m

   If you call the function with no input arguments it will ask you for the parameters.

Acknowledgements
This submission has inspired the following:
Graphical Points Selection
MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (15)
21 Mar 2007 Zhijun Wang

Very good work!

12 Apr 2007 vaibhav Waghmare

Thanks Thomas,
This is a really very nice utility b'coz, GUIDE helps us to develop a gui and gives basic m file which does not have programming details. m file developed by this function is really excellent and can help us to modify the properties of image

Thanks

12 Apr 2007 vaibhav Waghmare

I wish to have updated copy of the same utility. Can you please mail me.

Thanks

26 Jun 2008 Nicolas MONTAGNON

Great job Brother !

10 Jul 2008 Thierry Dalon

Great! Well done.

14 Jul 2009 qooroo

really really nicely done.

16 Apr 2010 Christian Wörner

Wow, nice work.

03 Jun 2010 Jonathan Lister

This worked really well. I had a very complicated custom plotting tool that I developed in 2009a. My tool worked well until I tried to run it on an older version (7.1 2005b0-ish). The fig file binary must have changed between those versions. This tool has helped me start to work around that issue. Thanks!

I have a suggestion:
Although my custom toolbar and the push and toggle buttons were translated perfectly, the tool did not preserve their order. I would like to see your tool do that in the future, as well as copy over all of the callback and other functions in the original m-file.

28 Mar 2011 Ian

This has converted a number of Guide GUIs into more managable M files without trouble for me. The only thing missing is parsing the callbacks into the new M file.

19 Sep 2011 Martin1986

maybe iam to stupid but if i let it run i get always the error message
??? Undefined function or variable "listTemp".

Error in ==> fig2m at 430
  disp(listTemp.Tag);

if i comment this i become multiple error msg
fig2m
Index exceeds matrix dimensions.

fig2m
Reference to non-existent field 'samplerate3'.
i use i with M2009b i whould be happy if someone have an idea...

19 Sep 2011 Martin1986

Okay, i think i get the Problem, but iam not sure why, it works for guis which have no input/output o.O so my maingui works but the guis which get called from the main doesn't work

12 Dec 2011 Dion

This is a great tool and it's surprising that something similar has not been implemented within Matlab.

22 Feb 2012 Robert W.

same problem as martin.

05 Mar 2012 Otis

Good work!! Did just what I needed!!

22 Mar 2012 Urs Schuerch

Beautiful, many thanks.

Please login to add a comment or rating.
Updates
21 Jun 2007

- Add Support for UserData property
- Bug correction in String property value generation

14 Apr 2010

- Change the function name from generate_m_file to fig2m
- Bug corrected for generation of String property value containing new line and ' characters.
- Add support for uitoolbar, uipushtool and uitoggletool
- Add support for uitable controls

Tag Activity for this File
Tag Applied By Date/Time
gui tools Thomas Montagnon 22 Oct 2008 09:05:10
example Thomas Montagnon 22 Oct 2008 09:05:10
generate mfile Thomas Montagnon 22 Oct 2008 09:05:10
example Egemen 06 Jan 2012 15:26:19

Contact us at files@mathworks.com