Can someone help me execute this app subroutine in the background?
Hi everyone... first time posting on here.
I have an app which I have been developing for quite some time now. Without going into a huge amount of detail... I have a subroutine (function) called 'CalculateMetrics' which goes and calculates a whole host of figures, fills a bunch of text/number boxes with them, replots a number of plots... a whole bunch of stuff.
I would like to get this to execute in the background rather than serially - which pauses everything for a second or two. I have tried 'parfeval'... using code like this:
`f = parfeval(backgroundPool, @ CalculateMetrics, 1);`
`fetchOutputs(f)`
But the error I get is,
"Error in SpeechBreathingZeroed>@(src,event)GetSelection(app,src,event) (line 15264)
set(app.SpeechBreathingAssessmentUIFigure, 'WindowButtonUpFcn', @ (src, event) GetSelection (app, src, event));
Caused by:
Unrecognized function or variable 'CalculateMetrics'."
This is even though CalculateMetrics is, definitely, the name of the function. This is my first time trying to use parallel evaluation to try to speed things up... what am I doing wrong?