![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1146545/image.png)
Live Tex Variable Updates the Whole Script Despite Run Option Set to "Current Section"
1 回表示 (過去 30 日間)
古いコメントを表示
I've attached a live tex (challenge1) which finds the shortest path of a dag.
In my Bellman-ford function, I tried to use a slider control to vary the source node (s in the script) for the bellman-ford algorithm so that I could trace the shortest path from the source to the root using the highlight function.
My problem: everytime I update s, the whole script updates as well. I would like to use the randomly generated digraph I have and update only the source node.
I already set the "Run" settings to "current section" and "current section to end," but it still updates everything, generating a new digraph in the process. What am I missing?
I've attached my code for your review.
Thank you!
0 件のコメント
採用された回答
Cris LaPierre
2022 年 10 月 5 日
編集済み: Cris LaPierre
2022 年 10 月 5 日
Your script does not have any sections in it, so the whole script runs each time. You must add a section break before your Bellman-Ford Algorithm to separate the two blocks of code into different sections.
You'll find Section Break in the "Section" grouping of the Live Editor tab's toolstrip.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1146545/image.png)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Construction についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!