Rank: 3048 based on 40 downloads (last 30 days) and 1 file submitted
photo

Alex

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Alex
Updated   File Tags Downloads
(last 30 days)
Comments Rating
05 Dec 2011 Screenshot Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex class, gui, passing gui data, passing data, control design, data import 40 10
  • 5.0
5.0 | 2 ratings
Comments and Ratings by Alex View all
Updated File Comments Rating
01 Jul 2014 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex

The file standard_fig.m only exists as a "path" to the actual gui figure file. The contents of the file itself are irrelevant.

I normally leave all of the event handles in that file blank, to avoid confusion. establishing your own event handlers in your class function will overwrite any existing ones in the fig.m file. However, I am uncertain what will happen to events that are not rewritten. The 2 possibilities are that they exists and could still be used, or that they are completely ignored.

When I get a change, I will run a test to see what happens and reply again.

13 Mar 2013 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex

Could you rephrase your P.s. question? I'm not understanding what you mean.

06 Feb 2012 vecgcd Computes the GCD of the elements of the integer vector V. Author: Steven Gregory

I noted a mistake in my above code. the following line should go before the other code.

v = abs(sort(v, 'descend'));

06 Feb 2012 vecgcd Computes the GCD of the elements of the integer vector V. Author: Steven Gregory

I took a look and made some quick modifications to speed up the loop.

current_gcd = 0;
for i = 1: length(v)
loop_gcd = mod(v(i), current_gcd);
if(loop_gcd > 0)
currernt_gcd = loop_gcd;
end
end

This reduces your computation time by about 1/3 for small vectors. I imagine this will increase with larger vectors, because you do not run into issues where the v vector is increasing in size as the while loop continues. Also, as the above commenter noted, you have a line that should be commented out (e x = g).

Also, this adjustment means that it doesn't matter if it is a row or column vector.

05 Dec 2011 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex

The correct command line function is:
G = gui_class_example
or
gui_class_example

Apparently, I needed to add the mfile for the fig as well. The command guihandles(handle) appears to define the figure handle based off of the mfile name, not the fig file name.

You can do this yourself by using Guide. However, the updated zip file should be on here shortly.

Comments and Ratings on Alex 's Files View all
Updated File Comment by Comments Rating
01 Jul 2014 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex Alex

The file standard_fig.m only exists as a "path" to the actual gui figure file. The contents of the file itself are irrelevant.

I normally leave all of the event handles in that file blank, to avoid confusion. establishing your own event handlers in your class function will overwrite any existing ones in the fig.m file. However, I am uncertain what will happen to events that are not rewritten. The 2 possibilities are that they exists and could still be used, or that they are completely ignored.

When I get a change, I will run a test to see what happens and reply again.

26 Jun 2014 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex katerina

im working on making a gui as a class object, and i have a question about your code. is it necessary to write the functionality of the callback functions in standard_fig.m as well as in the mapped class function? this seems to add room for error with duplicate code. thanks!

28 Mar 2013 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex Harald Berndt

Addendum to my last comment: deleting the owning object does close the figure; closing the figure window clears (don't know if that's the right word) the object, but the variable it was assigned to still exists. That's OK, but it could be confusing.

28 Mar 2013 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex Harald Berndt

This is a wonderful idea! I will be using this approach for a database browser. However, the linking between figure and object doesn't work. Closing the figure does NOT delete the object, and deleting the object does NOT delete the figure. I tried some variations of your ideas - and the basic approach seems sensible - but something is preventing this to work. Is it the Matlab event handling?

14 Mar 2013 Example using a MATLAB Class to control a GUI This example shows how to use a Matlab class to control a gui. Author: Alex Jagatpreet

It's Ok. I solved it. I was asking that how can we create two different GUI figure windows for two different instances of classes.
I did it by changing the singleton property of GUI figure to false

Contact us