Skip to content

Instantly share code, notes, and snippets.

@stephanmg
Created October 24, 2020 14:56
Show Gist options
  • Save stephanmg/9476e14c3f99a5eb481624c99cab8a3a to your computer and use it in GitHub Desktop.
Save stephanmg/9476e14c3f99a5eb481624c99cab8a3a to your computer and use it in GitHub Desktop.
parpool(4)
parfor K = 1 : 4
if K == 1; compute_function_val(10); end
if K == 2; compute_function_val(20); end
if K == 3; compute_function_val(30); end
if K == 4; compute_function_val(40); end
end
function y=compute_function_val(m)
y=m;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment