Main Content

Procesar en segundo plano

Ejecute código en segundo plano y ejecute otro código al mismo tiempo

Al ejecutar código en MATLAB®, tiene que esperar a que el código termine de ejecutarse antes de poder ejecutar otro código. El grupo en segundo plano permite ejecutar código en segundo plano y ejecutar otro código al mismo tiempo. Por ejemplo, puede crear apps que siguen teniendo capacidad de respuesta al realizar cálculos en segundo plano.

Utilice parfeval con el grupo en segundo plano para ejecutar una función en segundo plano. parfeval devolverá inmediatamente un objeto Future que representa la función que se está ejecutando en segundo plano. Para obtener resultados de Future, llame a fetchOutputs.

Funciones

expandir todo

parfevalRun function in background
backgroundPoolEnvironment for running code in the background (desde R2021b)
fetchOutputsRetrieve results from function running in the background
afterEachRun function after each function finishes running in the background
afterAllRun function after all functions finish running in the background
cancelStop function running in the background
cancelAllStop all functions running in the background (desde R2022a)
waitWait for futures to complete
fetchNextRetrieve next unread outputs from Future array
FutureFunction scheduled to run
sendSend data to DataQueue or PollableDataQueue
pollRetrieve data from PollableDataQueue
afterEachRun function after data is received on DataQueue
parallel.pool.DataQueueSend and automatically process data
parallel.pool.PollableDataQueueSend and manually retrieve data

Temas

Introducción al procesamiento en segundo plano

Aplicaciones