creating a spectrometer app
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ilay perez
am 13 Dez. 2023
Kommentiert: Ilay perez
am 29 Dez. 2023
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 Kommentare
DGM
am 13 Dez. 2023
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.
Akzeptierte Antwort
Brahmadev
am 27 Dez. 2023
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!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Instrument Control Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!