- Avoid loops whenever possible.
- If you must loop, preallocate.
Appdesigner performance reduces drastically when acquiring data in loop
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Acquisition Toolbox Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!