Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1471
Number of posts: 2147

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
help with gui Posted by Srt252 on 19 Nov 2008 at 9:24 PM
so i need to make a gui with 2 push buttons, one that increments a counter displayed in a text box and one that clears the count. the only problem is that im not entirely sure how to work the clear button out... im using a persistent variable in the first push button function to increment the counter, but since its a persistent variable only that function can use it, so when i clear the counter with the 2nd push button, the text diplays 0, but next time it is incremented it will resume at whatever number it was on.
-this is for an assignment by the way, i need to email only the .fig and .m files, so i cant create a new m-file
Report
Re: help with gui Posted by rinoob on 7 Dec 2008 at 2:45 PM
: so i need to make a gui with 2 push buttons, one that increments a
: counter displayed in a text box and one that clears the count. the
: only problem is that im not entirely sure how to work the clear
: button out... im using a persistent variable in the first push
: button function to increment the counter, but since its a persistent
: variable only that function can use it, so when i clear the counter
: with the 2nd push button, the text diplays 0, but next time it is
: incremented it will resume at whatever number it was on.
: -this is for an assignment by the way, i need to email only the .fig
: and .m files, so i cant create a new m-file
:
what language are you using?
does your professor allow global variables?
if not pass by reference between the two functions.

Report
Re: help with gui Posted by Srt252 on 7 Dec 2008 at 3:34 PM
: : so i need to make a gui with 2 push buttons, one that increments a
: : counter displayed in a text box and one that clears the count. the
: : only problem is that im not entirely sure how to work the clear
: : button out... im using a persistent variable in the first push
: : button function to increment the counter, but since its a persistent
: : variable only that function can use it, so when i clear the counter
: : with the 2nd push button, the text diplays 0, but next time it is
: : incremented it will resume at whatever number it was on.
: : -this is for an assignment by the way, i need to email only the .fig
: : and .m files, so i cant create a new m-file
: :
: what language are you using?
: does your professor allow global variables?
: if not pass by reference between the two functions.
:
:
i got it, i was just having trouble passing the data through the handles, but it works now. thanks



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.