[SOLVED] Using global flags to advance in a script
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!