Rerun script with different table input
이전 댓글 표시
Hey,
I wrote quite a long script, that uses table data, like so:
Location = table1.Location;
Is there a way to replace "table1" in all lines of the script and replace it e.g. with table2? To get:
Location = table2.Location;
Additionally I'm relying on tablesizes in my script (probably not a good way to do that) but I manually entered e.g.:
sh(1:2734) = sh;
where (1:2734) represents the table size. Is there a way to have the following?
sh("tablesize") = sh
Thanks for your help!
댓글 수: 3
EmirBeg
2021년 5월 5일
As David already said try to index your code.
Anyways, if you want to change the name of a variable in the whole script once (maybe because you simply just want another name for it), you can also just change the name and then you will see that a little message like this pops up.

By pressing Shift and Enter Matlab changes every variable in the code for you. It's the same as the old fashioned Ctrl+F - Find & Replace.
Maybe it will be helpful one day.
Lukas Netzer
2021년 5월 5일
Lukas Netzer
2021년 5월 5일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Function Replacement에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
