MATLAB Answers

Why Matlab is not changing the name of the GUI window?

47 views (last 30 days)
G A
G A on 24 Jan 2014
Commented: Image Analyst on 30 Dec 2015
The names of my fig-file and main m-file are, for example, 'Version15.fig' and 'Version15.m' , however, after executing those files the name of the GUI window is still Version04 - without changing.

  0 Comments

Sign in to comment.

Accepted Answer

Amit
Amit on 24 Jan 2014
Open the fig in GUIDE. Right click on the figure and in the property inspector change the 'Name' to Version05.

More Answers (1)

Image Analyst
Image Analyst on 24 Jan 2014
Edited: Image Analyst on 24 Jan 2014
If you want to write professional looking code, QA guidelines suggest, as an option, that you put the version of your software somewhere, like on a splash screen or title bar of your app, or on some static text on the GUI. Here's a snippet for how to put the version number in the title bar of your code:
%------------------------------
% Set up version number and display in title bar.
titleBar = sprintf('My app - Version %s', Version_Number);
set(handles.figMainWindow, 'Name', titleBar);
Somehow you set Version_Number to be what you want it to be. For example, you could hard code it into the code if you want (not what I do, but you could). This way whenever anyone runs your code they know what version they're running. You should also log the version number into your output (for example an Excel workbook). This is particularly important if you are using your software for any claim support or intellectual property (patent) work.

  5 Comments

Show 2 older comments
Image Analyst
Image Analyst on 30 Dec 2015
Mike, I do something similar to this to set the version number of my particular program (as opposed to the MATLAB version which you can't change):
Version_Number = '1.0';
fprintf(1, 'Running %s, version %s.\n', mfilename, Version_Number);
%------------------------------
% Set up version number and display in title bar.
titleBar = sprintf('%s - Version %s', mfilename, Version_Number);
set(handles.figMainWindow, 'Name', titleBar);
If you need Version_Number anywhere else, you can make it global.
Mike Thompson
Mike Thompson on 30 Dec 2015
@Image Analyst - Thanks for your reply. I was looking for a programmatic way to access the version number that is entered in the compiler dialog:
It think it is best to have the version number only stored once, and the above dialog appears to be the most obvious place to put it. I just took over this project and I assumed that was the place to record the version number. It turns out that the previous developer has it stored in at least two other places for a total of three. I am also interested in accessing the "Author Name", "Email" and the other fields in the same dialog.
Image Analyst
Image Analyst on 30 Dec 2015
Sorry, I don't use their deploytool because of limitations that I hope one day they will remove (like the ability to specify where files are installed to). I'm not sure how to access the version number created by deploytool inside your program. Perhaps it's stored in the metadata of your executable and you can get it with fileinfo() - I don't know. Otherwise, call them and ask them - after all you've paid a huge amount of money for the compiler to may as well get your money's worth.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by