How to display the code is running?
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Benson Gou
      
 el 19 de En. de 2019
  
    
    
    
    
    Respondida: Image Analyst
      
      
 el 19 de En. de 2019
            Hi, All,
I have a code which takes several minutes to finish the execuation. I donot want to display the middle results on the screen, but I do want to show (to anyone who runs it) that the code is running on the screen. Could anyone tell me how to do that?
Thanks. Benson
0 comentarios
Respuesta aceptada
  Image Analyst
      
      
 el 19 de En. de 2019
        See these snippets:
	% Change mouse pointer (cursor) to an hourglass.
	% QUIRK: use 'watch' and you'll actually get an spinning blue circle (Windows 10) or an hourglass not a watch.
	set(gcf,'Pointer','watch');
	drawnow;	% Cursor won't change right away unless you do this.
	% Change mouse pointer (cursor) to an arrow.
	set(gcf,'Pointer','arrow');
	drawnow;	% Cursor won't change right away unless you do this.
0 comentarios
Más respuestas (1)
  Walter Roberson
      
      
 el 19 de En. de 2019
        If the code takes a known number of iterations, then you can use waitbar() to display a progress bar.
If the code does not take a known number of iterations, then you would not know what value to update waitbar with. It can be formally proven that there are tasks for which you cannot possibly figure out how many iterations you will need ahead of time, where you can only recognize that you achieved a goal without any possible clue as to how much work you will have to go through to get there.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


