generating animation (e.x. animated gif) while function is running
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi at all,
I have programmed a tool that analyzes measured data, performs several calculations and generates an excel report at the end. Some of its functions or better calculations take a bit of time for their execution, so I want to generate a small animation on the Main-GUI to show the user that the tool is still running.
My idea is to put an animated gif on the GUI while the functions are running and to replace it by an still image when the tool is on idle.
Is this possible somehow? Or, if not is there an other way to achieve this idea?
Thanks for your help.
Greetings, Stefan
댓글 수: 0
채택된 답변
Jan
2011년 8월 24일
You cannot display an animated GIF with standard MATLAB methods.
Usually a progressbar is displayed for such jobs. Beside MATLAB's WAITBAR, there are a surprising large number of submissions in the Fex: progressbar? .
If your code contains a loop, you can update an image after a certain time step. Or you can create a timer object, which updates an image object. A DRAWNOW might be needed to allow the timer's callback to be executed.
If you call a single command, which takes a lot of time (e.g. invert a giantic matrix), I do not know a sufficient method, because MATLAB is a single threaded application (even if it calls multi-threaded subfunctions) and the main thread cannot be interrupted. It should be possible to start an independent external function, which updates an animation, but this will niot appear inside the MATLAB figure.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Animation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!