Similar to this question:
Can a Matlab PARFOR loop be programmatically switched on/off?
I'd like to know if I can use something similar for regular for-loops. Unfortunately I don't actually have a working copy of Matlab at the moment so I can't test this in my own code!
if (flag)
for i = 1:n
else
parfor i = 1:n
end
% Do loop tasks.
end
EDIT -
(Upon further reflection, I've put greater detail into my question)
This is what I currently have:
for i = 1:numel(Ffi)
Ff = Ffi(i)
for j = 1:numel(RelToli)
RelTol = RelToli(j)
for k = 1:numel(ki)
k=ki(k)
% solve
end
end
end
I want to change it so that the user can choose a single value for Ff/RelTol/k directly (via GUI/requested input) or, if not specified by the user, to use all values in a pre-defined array (Ffi/RelToli/ki respectively) via a for-loop.