how to switch on a function for a specific condition is met

 Accepted Answer

function_is_on = false;
...
while true
...
if function_is_on; call_function(); end
...
if condition_is_met; function_is_on = true; end
...
end

More Answers (0)

Categories

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!