Appdesigner performance reduces drastically when acquiring data in loop
이전 댓글 표시
Hello everyone,
I am using Appdesigner to build a GUI to acquire data from a NI device, The idea is to acquire EMG data for 3 seconds in background and wrtie the data to a csv file after the data acquistion is complete. And this process will be repeated 50 times. The process is smooth for upto 5 iterations and after that , matlab takes a lot of time to execute the same lines of code it did before and the screen freezes in the mean time.
Is there anyway to overcome this problem? or are there some "best practices" for appdesigner.
Or should i use GUIDE?
Thank you.
댓글 수: 3
Chris
2021년 12월 12일
Best practices for anything in Matlab would probably begin with:
- Avoid loops whenever possible.
- If you must loop, preallocate.
Aside from that, it would be helpful if you could post the contents of the loop and any relevant functions.
If for some reason you can't do that, you could try using the profiler to figure out where the hold-up is.
Ajai Singh
2021년 12월 15일
Geoff Hayes
2021년 12월 17일
@Ajai Singh - consider creating the daq object outside of the loop rather than on each iteration. Or perhaps comment on your above implementation and why you have chosen to do the above (wait for the button press, etc.).
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 National Instruments Frame Grabbers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!