f



Matlab GUI with timer in the background

Hello everyone,

I have a GUI (developed using guide) and I need to show the current time and date in one of its corners, I have written a simple code which works alright, however I am not sure where in the GUI code to use it. When I use the code in GUI_OpeningFcn, which executes just before gui is made visible, it shows the time but MATLAB remains busy and I won't be able to run anything else from the command window, furthermore, I am not sure how to stop the timer and delete the timer when the GUI is closed. When I use handles to save timer created in OpeningFcn and later delete the timer in OutputFcn, I get an error saying my handle is invalid! The code is posted below and I appreciate any help with this.

timex=timer;

set(timex,'executionMode','fixedRate');
set(timex,'timerFcn',{@timexup,handles});
set(timex,'period',1);
start(timex);
%handles.output=0;
if(~ishandle(handles))
    stop(timex);
    delete(timex);
end

function timexup(obj,event,handles)
set(handles.text6,'string','');
pause(0.5);
set(handles.text6,'string',num2str(datestr(now)));
set(handles.text6,'Fontsize', 10, 'FontWeight', 'bold');
pause(0.5);
0
nnikvand (11)
1/6/2013 5:17:08 AM
comp.soft-sys.matlab 211266 articles. 15 followers. lunamoonmoon (258) is leader. Post Follow

0 Replies
289 Views

Similar Articles

[PageSpeed] 39

Reply:

Similar Artilces:

Need timer in GUI...Is there a timer in Matlab 7 GUI?
Hi all, In designing a Matlab 7 GUI, I often need to use timer to do something periodically and each time let the timer to trig a callback function... How can I do that? Have you looked at the timer function? http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/ch14_pro.html Stuart "lucy" <losemind@yahoo.com> wrote in message news:cg2vmd$lt6$1@news.Stanford.EDU... > Hi all, > > In designing a Matlab 7 GUI, I often need to use timer to do something > periodically and each time let the timer to trig a callback function... > > How can I do tha...

Access from MATLAB to a non-MATLAB GUIs
Hallo everybody, In one of my MATLAB functions I invoke external EXE file (another program), which makes some calculations. At the end of the calculations a message appears if I want to quit the exernal program (with 'Yes' and 'No' buttons). I want to close this message, because it interrupts the executaion of the whole MATLAB function(a batch file). The message is generated from the exernal program, not from MATLAB, so I can't use a MATLAB handle to close it. So, does anybody knows how I can close those non-MATLAB generated message (GUI) with a command in the MATLAB...

How do I Run a Matlab 6 GUI in Matlab 5
Hi there everyone!! I am designing a Matlab 6 GUI at the university, but have Matlab 5 at home. If I try to run the Matlab 6 Gui,it doesnt want to open. Is there a way to open Matlab 6 GUI's in Matlab 5. Any help will be appreciated Hugo ...

call to matlab function from matlab GUI stalls
I have the following problem. I have created a simple Matlab GUI (for our purposes it can just be considered a Matlab function) which gathers some parameters and then invokes a perl script that in turn calls other perl and Matlab scripts to perform various calculations. If instead of using the Matlab GUI, I run the perl command from the unix prompt, the flow runs and concludes correctly. BUT if I invoke the flow from the Matlab GUI (function), then it runs correctly by calling various other perl and Matlab scripts, but then when it reaches the third Matlab function call, it consistently stalls...

Run Matlab ... from Matlab
Hello, Is there any limitation to run Matlab from Matlab, as a system command, on Linux platforms ? I tried to start Matlab, both using the ! syntax (!matlab&) or the system command (system('matlab&')), the Matlab splash screen appears, but the new Matlab session closes rapidly . When I do the same with a script of mine (system('matlab -r "myscript"&')), my script is being executed, but Matlab finally crashes . If I remove the &, it works well, but the first Matlab session is blocked till I close the second one . I run Matlab on a Linux 64bits platform . Thanks in advance, Nicolas On 10-12-03 01:22 AM, Nicolas wrote: > Is there any limitation to run Matlab from Matlab, as a system command, > on Linux platforms ? > I tried to start Matlab, both using the ! syntax (!matlab&) or the > system command (system('matlab&')), the Matlab splash screen appears, > but the new Matlab session closes rapidly . > When I do the same with a script of mine (system('matlab -r > "myscript"&')), my script is being executed, but Matlab finally crashes . > If I remove the &, it works well, but the first Matlab session is > blocked till I close the second one . > I run Matlab on a Linux 64bits platform . It appears there is a parsing problem in the script that invokes Matlab. Here's an example of what I had to do to get around it: !matlab -r \""...

MATLAB talking to MATLAB?
For my project, I need to have a client program (MATLAB executable) talking to a server program (also MATLAB executable) to query data. Is there any easy way to accomplish that? I appreciate any help that I can get on that. Thanks. Cheers, Hoi Oops, I forgot to mention. There are multiple clients querying the server, so I guess serial objects + remote serial port wouldn't work. "Hoi Wong" <wonghoi.ee@gmail.com_> wrote in message news:f3ald6$gg4$1@news.Stanford.EDU... > For my project, I need to have a client program (MATLAB executable) > talking to a ser...

Countdown Timer in MATLAB GUI
Good day! I saw the following codes on this page: http://www.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html t = timer('TimerFcn', 'stat=false; disp(''Timer!'')',... 'StartDelay',10); start(t) stat=true; while(stat==true) disp('.') pause(1) end It actually works however it diplays something like this due to its configuration: .. .. .. .. .. .. .. .. .. .. Timer! My question is that: is there a way that all the dots could appear as different numbers? As if the result would...

To change Background in MATLAB GUI
How can one change the background to a picture in MATLAB GUI? I mean, I want a picture in the background instead of the static colour background. On Mar 17, 1:17=A0pm, sindhu...@gmail.com wrote: > How can one change the background to a picture in MATLAB GUI? I mean, > I want a picture in the background instead of the static colour > background. As far as I know (and I did try some experiments with some things that seemed reasonable), it can't be done. GUIDE is too primitive. You'd have to use another front end such as Visual Basic. Regards, ImageAnalyst &qu...

Matlab 7 ----> Matlab 6 GUI conversion
Hi, I have a question related to whether it is possible to convert a .fig file that was created in Matlab 7 into Matlab 6. I am running on my machine Matlab 6 and when i am trying to run the gui created in a recent version of Matlab, it fails Thanks George close your pc and go to sleep magka moy ...

Matlab Tutorial 10 &#8211; Matlab GUI tutorial
http://learnbyexamples.org Why use a GUI in MATLAB? The main reason GUIs are used is because it makes things simple for the end-users of the program. If GUIs were not used, people would have to work from the command line interface, which can be extremely difficult and fustrating. Imagine if you had to input text commands to operate your web browser (yes, your web browser is a GUI too!). It wouldn&#8217;t be very practical would it? In this tutorial, we will create a simple GUI that will add together two numbers, displaying the answer in a designated text field. This tutorial is written for...

Importing matlab 6.5 GUI in matlab 7.1
I use MATLAB 7.1. If I open an existing GUI project built in 6.5 MATLAB with GUIDE tool, .fig is loaded correctly but .m is not loaded (it has the same name of .fig), then when I run the GUI and click on buttons I got function not found errors: ??? Undefined command/function 'fsv'. ??? Error while evaluating uicontrol Callback. How can I reassociate .m with his .fig? ...

How to transfer a VC matrix to matlab workspace and manipulate it under matlab GUI ?
I would like to transfer a VC matrix to matlab main program workspace, than i can observe it by Matlab array editor, or directly manipulate it under matlab GUI. I tried engdemo.c, but i found that under this mode, matlab runs on background, there is no matlab main program GUI, I can only excute matlab command on C, and see result, like ploting. how should this be done ? Thank you so much. "KS " <CHH@itri.org.tw> wrote in message <hs008g$256$1@fred.mathworks.com>... > I would like to transfer a VC matrix to matlab main program workspace, > &...

Convert GUI of Matlab R2006a&b to Matlab 6.5
Could you please tell me how to convert a GUI application created in Matlab R2006a&b to executable file in Matlab 6.5? Thank you. ...

Matlab GUI: can I design auto-hide tool-bar in Matlab?
Hi all, I want to design a tool bar that can be dock on to the top of the screen and can be auto-hide. Can Matlab do this? I ask this question because in my program, everything else is in Matlab, but the GUI looks ugly with simple buttons and menus. I want to have better GUI. Is that doable in Matlab? Thanks a lot, -Gino ...

Matlab gui as application gui
Hi , Is it possible, to use (or to develop) an application gui that is just like the Matlab gui ? I would like to have several workspaces with different ways to show data. Many IDE (e.g Eclipse, Visual Stusio etc) have a common type of IDE. I would like to have such a structure for my app. Any advise how to do this ? Thanks Arthur ...

running matlab gui executable(.exe) file in windows without matlab installed.
is it possible to run an executable file derived from matlab gui, in windows pc without matlab and MCR installed? praveen "praveen " <praveenignatius17@gmail.com> wrote in message <hg7epv$ntp$1@fred.mathworks.com>... > is it possible to run an executable file derived from matlab gui, in windows pc without matlab and MCR installed? > > praveen My understanding - for what its worth - is that you need to have either Matlab or the MCR installed. Regards Dave Robinson "Dave Robinson" <dave.robinson@somewhere.biz> wrote in message &...

Matlab Timer Erases GUI Handles Structure?
I needed to have a constantly running timer for a program I am working on. I want to use the TIMER function in the MATLAB GUI I made, but the timer, when started, seems to erase my handles structure, as I get "Reference to non-existent field" errors. I want the timer to post variable to the handles structure which I can access throughout the GUI. Can anyone help? My current code:******************************************************* tic; accurateTimer = timer; set(accurateTimer, 'Period', .1) set(accurateTimer, 'TimerFcn', 'handles.elapsedTime = toc;') start...

GUI with timers causing complete Matlab lockup
Hello all, I have a somewhat complex GUI-based Matlab control panel that is having problems. Background: The panel is streaming data out a COM port at a fixed rate (X points every Y seconds). It also reads the com port every Z seconds to look for responses and, if they exist, parses and buffers the responses. A graph is also updated periodically to show the received, buffered data. Each of these functions is timer-driven: 1. Stream data timer 2. Read COM port timer 3. Update graph timer The first timer shuts down all of the timers in its callback once all the data has been...

Open GUI without matlab running in the background
I would like to open my GUI using a .bat with matlab.exe -r mygui without seeing matlab in the background, I have tried the atributes -nosplash and -nodesktop but I still get a matlab command window and a the C:\\WINNT..... can anyone help me on this? thanks P�l ...

How can I execute a GUI app. done on matlab 6.5 to matlab 6.1
How can I execute a GUI app. done on matlab 6.5 to matlab 6.1 my GUI have 2 *.fig and 2 *.m and first GUI pass result to the second ...

Image Background hides the plots and the panels in Matlab GUI
Hallo, I am a beginner in using the Matlab GUI, and I have a problem setting an image as a background of my GUI: 1. The code: Within the function '' mygui_OpeningFcn '' I wrote the code: ah=axes('unit', 'normalized','position', [0 0 1 1]); bg=imread('seaside.jpg'); imagesc(bg); set(ah,'handlevisibility', 'off', 'visible', 'off') uistack(ah,'bottom'); 2. The Problem: As I run the code, my GUI has a beautiful image of the seaside as background, BUT I cannot see the Panels anymore (they are behind the background). Therefore, I cannot see the graphs I would like to plot (In mygui there are 3 or 4 axes, where I want to plot some data); they rest behind the background as well. 3.What I have already tried: I have already tried to use the uistack 'up', to select 'bring to front'..but nothing Thank you very much to anyone could help me! Andrea ...

Setting Timer in the Callback function of Slider in MATLAB GUI
Hello All, At present I am developing a GUI in MATLAB, which includes a slider and a plot window. I wish to measure the time between one change in the slider value to the other, and plot the present value (read from the Slider, using get(hObject,'Value') in real-time fashion till there is a change in the present value of the Slider. I used tic-toc function, but it does not help to plot the present value read from the Slider in real-time. I wish to have a counter for the time and every moment keep plotting the value in the plot. Please suggest your precious inputs. Regards, Prasad ...

Can Matlab 6.5 automatically convert GUI-based Matlab program to stand-alone applications?
Hi all, I am using Matlab R2006a on Windows XP. I can use mcc to automatically convert GUI-based Matlab program into stand-alone applications. But can Matlab 6.5 do the same thing? Suppose the matlab GUI program was built using "guide" in Matlab 6.5, can Matlab 6.5 's mcc convert it into a standalone application automatically? I don't have a Matlab 6.5, but does anybody have experience on that? We need a special feature from Matlab 6.5... Thanks a lot! "Mike" <housing2006@gmail.com> wrote in message news:eui4uo$31f$1@news.Stanford.EDU... > Hi ...

GUI to matlab
I am working on a GUI, i have created a listbox in it which gives a list of .mat files. The trouble i am having is that once the listbox is populated i want a particular file to be selected and loaded.please help the last message i posted here was pretty hard to understand sorry abt it Munish Chaubey wrote: > > > I am working on a GUI, i have created a listbox in it which gives a > list of .mat files. The trouble i am having is that once the > listbox > is populated i want a particular file to be selected and > loaded.please help > > the last message i posted here ...

Web resources about - Matlab GUI with timer in the background - comp.soft-sys.matlab

Background Music (album) - Wikipedia, the free encyclopedia
^ Morris, Kurt. " Background Music – Overview" . Allmusic . Rovi Corporation . http://allmusic.com/album/background-music-r642918 . Retrieved ...

Android App OStream Speeds Up Facebook Experience By Synchronizing Content In Background
Facebook’s newly revamped Android application was rebuilt with a focus on speed, and startup oStream wants to help users of devices on that operating ...

Background for Dick Armey’s Endorsement of “Nothing for the Nation”
To truly grasp the profound nature of Dick Armey’s endorsement of Nothing for the Nation: Who Got What Out of Iraq, one must understand the events ...

Parse launches analytics tool, background jobs feature at first Developer Day conference
Parse , the Facebook-owned app development platform, held its first Developer Day conference in San Francisco Thursday, and the company launched ...

Easy Background Tasks in ASP.NET
As I work on the badge implementation for Stack Overflow, I needed a way to call the code that detects and awards the badges out of band. Traditionally ...

Wallpaper Studio Pro HD - Themes & Backgrounds for iPad on the iTunes App Store
Get Wallpaper Studio Pro HD - Themes & Backgrounds on the App Store. See screenshots and ratings, and read customer reviews.

Apple/FBI fight looks destined to go all the way to the Supreme Court as more background is revealed
... doubt about Apple’s determination to fight the matter all the way to the U.S. Supreme Court, that doubt appears to be removed by further background ...

Latest Opera Max update brings Smart Alerts to help you manage sneaky background data usage
... in this update is the addition of Smart Alerts, which will allow the app to notify you when an unused app is using too much data in the background. ...

Uber settles “industry-leading background check” class-action for $28.5M
... class-action lawsuit originally filed in late December 2014 by six men who argued that the startup’s claim of running "industry-leading background ...

Opera claims you're using 30 percent of your mobile data on background apps
... through it. Unless you're predominantly on Wi-Fi then you're likely wondering where all of that data is going. The answer, of course, is background ...

Resources last updated: 3/10/2016 10:12:17 AM