creating a spectrometer app
10 次查看(过去 30 天)
显示 更早的评论
I'm trying to build a matlab app to control spectrometer and other instruments simultaneously.
I'm still new to to this and it's going very slow.
My main problem now is seeing the data in a live plot.
For example: If I'm moving a light source back and forth from the spectrometer I want to see the change in the light intensity as I move the light source with out plotting it manually again and again.
If any one could shed light on how to create such a live plot it would be very helpful. I tried to do it with a loop that updates the y axis but it didn't work.
thanks.
2 个评论
DGM
2023-12-13
We don't know anything about the features or interfaces of your spectrometer, how you're getting data from it, or what form that data takes. Consequently, we have no idea why what you tried didn't work. You'll have to provide more information.
采纳的回答
Brahmadev
2023-12-27
As per my understanding, the spectrometer app that you have created is calling the "plot" function for drawing each new iteration of data that is recieved from the spectrometer. If the data is large and the "plot" or similar functions are called repeatedly, this can cause the app to become slow. As an alternative, if the entire data is not changing at each data point, it can be useful to update just the part of the data that has changed.
Some other things to consider are:
- The "drawnow" can be used to flush the event queue and update the figure window immediately without waiting for the loop to end. Also, "drawnow limitrate" can be used to limit the number of updates to 20 frames per second. Refer to the following MathWorks documentation for more information: https://www.mathworks.com/help/matlab/ref/drawnow.html
- On the other hand, you can update the plot less frequently by using a conditional statement or by inserting a "pause" command to control the update rate. Refer to the following MathWorks documentation for more information: https://www.mathworks.com/help/matlab/ref/pause.html
Hope this helps in resolving your query!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Instrument Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!