Detect Matlab function run in parallel worker
Matlab functions can detect if they are being executed in a Matlab Parallel Computing Toolbox parallel worker using is_parallel_worker.m. This can be useful to workaround parallel plotting bugs or for whatever reason distinct parallel logic might be desired in a function.