[SOLVED] Using global flags to advance in a script
Afficher commentaires plus anciens
Hello fellow community
I want to make a script with converting it into a GUI in the future in mind. It's purpose is to run parts of an algorithm one after another when i want to. Here I've submitted simplified version to replicate my problem. I'll be extremelly thankful if you can help me.
global locate_Flag;
global aim_Flag;
global throw_Flag;
locate_Flag = 0;
aim_Flag = 0;
throw_Flag = 0;
if locate_Flag == 1
disp('located succesfully');
if aim_Flag == 1
disp('aimed succesfully');
if throw_Flag == 1
disp('threw succesfully');
else
throw_Flag_temp = num2str(throw_Flag);
input(throw_Flag_temp);
str2double(throw_Flag_temp)
throw_Flag = throw_Flag_temp;
end
else
aim_Flag_temp = num2str(aim_Flag);
input(aim_Flag_temp);
str2double(aim_Flag_temp)
aim_Flag = aim_Flag_temp;
end
else
locate_Flag_temp = num2str(locate_Flag);
input(locate_Flag_temp);
str2double(locate_Flag_temp)
locate_Flag = locate_Flag_temp;
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!