This is the first part of my program, however I'd like the whole program to stop running and end, if , the choice is 'yes'. Because currently the code just keeps on running even after loading the saved model.
조회 수: 1 (최근 30일)
이전 댓글 표시
choice = questdlg('Would you like to load a saved spatial model?','Spatial Model','Yes','No, create new spatial model','No, create new spatial model');
if isequal(choice,'Yes')
disp('A previously saved spatial model has been loaded into the system');
load spatialModel.mat
else isequal(choice,'No, create new spatial model')
disp('Starting a new spatial model~~~~~~~~~~~~~~~~~');
end
댓글 수: 0
채택된 답변
David Fletcher
2021년 5월 7일
return should give control back to whatever invoked the script
choice = questdlg('Would you like to load a saved spatial model?','Spatial Model','Yes','No, create new spatial model','No, create new spatial model');
if isequal(choice,'Yes')
disp('A previously saved spatial model has been loaded into the system');
load spatialModel.mat
return
else isequal(choice,'No, create new spatial model')
disp('Starting a new spatial model~~~~~~~~~~~~~~~~~');
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Schedule Model Components에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!