Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compatibility between Mac and Windows MATLAB Gui

I am quite familiar with MATLAB, although not so much with writing GUIs in it. Now my boss gave me a MATLAB program with GUI which was developed on a Windows machine and runs there without problems. I copied it to my mac (osx 10.6.5 with MATLAB R2009b) using a USB memory stick and tried to work on the files on my computer.

When starting the GUI, some of the callbacks are executed, some not. I was able to open the figure file containing the GUI in GUIDE, but there cannot click on the callback fields in the Property inspector. Also some components are not shown in GUIDE which are visible when running the GUI. First I suspected it might be corrupted by changed newline characters, but learned that .fig files are binary, so this should not be the case. I opened the binary .fig file with a text editor and found the following ASCII line followed by binary data:

MATLAB 5.0 MAT-file, Platform: PCWIN, Created on: Tue Aug 10 17:11:57 2010

Are the GUIs created with MATLAB OS specific? Wouldn't this be really stupid?

I opened the files on the windows machine again and tried to export them or save them by specifying that I want them to be compatible with other operating systems but could not find an option like this.

Of course I researched this on google, and wondered that I did not really find something related. If an incompatibility exists, I think this would have been discussed, right?

Anyone knows about it or had the same problem before?

like image 984
dedan Avatar asked Nov 30 '10 09:11

dedan


1 Answers

Hmmm, ok. Well, the answer is quite embarrassing but still bears some potential to learn from it. The folder that my boss gave me contained a lot of files and figures with similar names, like:

  1. bla1.fig
  2. bla.fig
  3. bla0.fig

the simple problem was, the first time I opened the figure with GUIDE I opened figure bla.fig instead of bla1.fig. After this I always used the reopen function of GUIDE and did not see that it was always the wrong file. this caused the problems.

==> so there is no incompatibility between Mac and PC, although I wonder why the platform is written in the file then

==> it could have been a problem with backwards-compatibility as the original figure was created with MATLAB 5

==> as @Adrian and @Mikhail pointed out: it would be very very useful to use a Version control system in order to prevent to have hundreds of files with different numbers where most of them are of no use anymore

like image 147
dedan Avatar answered Sep 20 '22 23:09

dedan