How to reduce the rate MATLAB attempts to execute a function in the Value Changing callback
1 次查看(过去 30 天)
显示 更早的评论
Hello. I am writing an app in app designer and a part of it requires Matlab to graph a function. As I move a slider, I want the graph to change, so I used the 'Value changing' callback, but I realized that the calculation is taking too long for Matlab to keep up with. Is there a way for me to specify for Matlab to try to regraph only 10 times a second?
(I have tried to reduce lag time by creating a matrix that contains the values on startup, so all that the callback is doing is indexing the matrix, assigning values to X and Y, and then graphing)
1 个评论
Walter Roberson
2020-2-1
编辑:Walter Roberson
2020-2-1
One technique is to keep track of the last time the function was invoked, and if it was less than 1/frequency ago then return (without recording the time)
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!