Is it possible to only rename instances of a variable that appear in the code after the point at which you edit the variable selected? (shift+enter)

17 ビュー (過去 30 日間)
I want to change the names of all variables that share a common name, but only after a certain point.
v1 = 2
x = v1 + 3
y = v1 + 2
z = v1 + 4
in the code above, if I replace the name of v1 in line 2 with v2, and press shift + enter, it replaces every v1 to v2.
Is there a way for it to leave all lines of code above the current line unchanged?
Thanks
  6 件のコメント
Justin Skaggs
Justin Skaggs 2019 年 8 月 12 日
I think this would still be a really useful feature to have.
David Kelly
David Kelly 2020 年 8 月 19 日
Yes, This would be a great feature!

サインインしてコメントする。

回答 (1 件)

Jim Riggs
Jim Riggs 2019 年 8 月 12 日
編集済み: Jim Riggs 2019 年 8 月 12 日
I use a tool called UltraEdit. It has that capability. In the find/replace tab there is a checkbox for "replace all is from top of file".
Simply uncheck this box and "replace all" operates from the cursor to the end of file.
UltraEdit can also restrict edits to a selected column or range of columns of data. Great feature.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by