Referencing a line of code

Is there any way to reference a specific line of code (This line may change).
For instance if I want to remember where to change a value within the code I want to have some refernce at the top of the code to help me quickly find where to make the change.
%To change SG value skip down to line __ or change equation on line __
Then farther down in my code I will have.
SG = 0.895
SG = (EQUATION)
So can I somehow reference the lines? I don't want to just put the current line number because that can and will change. I also want to keep things in the order that they are and not move things around much. So I don't want to just put the SG = 0.895 at the top of the code.
I'd appreciate any advice. Thanks!

 採用された回答

per isakson
per isakson 2012 年 8 月 11 日

1 投票

Search "TODO/FIXME Report" in the online help
% TODO: To change SG value skip down to line __ or change equation on line __

1 件のコメント

Sean de Wolski
Sean de Wolski 2012 年 8 月 13 日
Learn something new every day!

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

その他の回答 (3 件)

Matt Fig
Matt Fig 2012 年 8 月 10 日

1 投票

Why not just Ctrl+f then type:
SG =
To find the line where that piece of code is located? This always works for me...
Sean de Wolski
Sean de Wolski 2012 年 8 月 10 日

0 投票

N. MATLAB does not have a goto statement. Use if/elseif/else/end or switch/case to make a decision tree.
Walter Roberson
Walter Roberson 2012 年 8 月 10 日

0 投票

Put a specific comment in the line to be changed, and refer to that comment, expecting that the user will search.

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by