Code covered by the BSD License  

Highlights from
Convert FIG to MATLAB code

4.875

4.9 | 16 ratings Rate this file 39 Downloads (last 30 days) File Size: 8.54 KB File ID: #14340

Convert FIG to MATLAB code

by

 

20 Mar 2007 (Updated )

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 file inspired Graphical Points Selection and Img2curve.

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (22)
14 Jan 2014 Jonathan C. Lansey  
16 Dec 2013 francesco

hi,
when I run the fucntion it ends up with an error, how solve it?

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

20 May 2013 Martha

fig2m worked perfectly for me in R2012a. @shikhar, when I first ran the code, I encountered the error you describe; the problem seemed to be in setting the GUI directory. If you run the code with no inputs, it prompts you to select the path and .fig file, which allows it to run to completion without error.

11 Apr 2013 shikhar

tried to run it but i got the following error:

Error in fig2m (line 430)
disp(listTemp.Tag);

i tried it with 3 different matlab versions and currently i am using matlab R2012b but the same error appears in every case ...how did you make it run ? please reply....

11 Apr 2013 shikhar

tried to run it but i got the following error:

Error in fig2m (line 430)
disp(listTemp.Tag);

i tried it with 3 different matlab versions and currently i am using matlab R2012b but the same error appears in every case ...how did you make it run ? please reply....

11 Apr 2013 shikhar

tried to run it but got the following error:

Error in fig2m (line 430)
disp(listTemp.Tag);

i tried it with 3 different matlab versions and currently i am using matlab R2012b but the same error appears in every case ...how did you make it run ? please reply....

11 Mar 2013 Amihay Blau

Great program!
helps when working with multiple Matlab versions, when creating more than one form in a GUI and a lot more.

thanks

22 Mar 2012 Urs Schuerch

Beautiful, many thanks.

05 Mar 2012 Otis

Good work!! Did just what I needed!!

22 Feb 2012 Robert W.

same problem as martin.

12 Dec 2011 Dion

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

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

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...

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.

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.

16 Apr 2010 Christian W├Ârner

Wow, nice work.

14 Jul 2009 qooroo

really really nicely done.

10 Jul 2008 Thierry Dalon

Great! Well done.

26 Jun 2008 Nicolas MONTAGNON

Great job Brother !

12 Apr 2007 vaibhav Waghmare

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

Thanks

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

21 Mar 2007 Zhijun Wang

Very good work!

Updates
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

Contact us