Start script at a chosen line
이전 댓글 표시
As we know it is not possible to modify a running script. You have to stop the script and restart it for the changes to become active. Now I wonder if it is possible to jump into a script at a chosen line. So one could stop a running process, make the desired changes and then have the program continue in the modified version without running the code before the changed part again.
댓글 수: 4
Rik
2018년 9월 26일
You can either temporarily comment out all previous code, or run the rest of the code as a section.
Adam
2018년 9월 26일
Turn it into functions instead. You can edit any function that isn't currently being executed, whether it is called before or after the currently executing code or not.
Alexander. Koutsouris
2020년 10월 26일
Start you script with:
i=0;
if i==0
else
And set the "end" at the point where you want to run the script
Rik
2020년 10월 26일
@Alexander, that will have the same effect as commenting out code. It would also make more sense to me if you use this instead:
if false
%code that shouldn't run
end
%code that should run
That way you don't interfere with any variable that might be used in the rest of the code.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!