Changing several occurrences of the same variable at once

조회 수: 27 (최근 30일)
Bo Landess
Bo Landess 2012년 10월 21일
Hi Everyone,
Very recently, I began using MATLAB at work and am wondering what setting allows me to highlight a variable, change it to a new name, and have the option to press "Shift+Enter" (I think...) and it will change all occurrences of that same variable to the new name. My laptop version at home does it; I would like to set it to function on my work computer as well.
Thanks for the help,
BL

답변 (1개)

Star Strider
Star Strider 2012년 10월 21일
This applies to 2012b and may apply to other versions as well:
  1. Open the Preferences window (in the ENVIRONMENT ribbon tab), or type preferences on the Command Line,
  2. Expand Editor/Debugger in the left panel of the Preferences window,
  3. Highlight Language to open Editor/Debugger Language Preferences,
  4. Check the box Enable automatic variable and function renaming.
That should allow you to do what you want.
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 10월 21일
Variable renaming was also in R2012a, but I think that might have been the first version for it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by