can mlint report undefined variables?
古いコメントを表示
Is there a way to tell mlint, or is there some other way, to report on unknown identifiers in functions. For example,
function r = test_unknown_variables(x,y)
r = w + v;
end
>> mlint('test_unknown_variables')
L 1 (C 38): Input argument 'x' might be unused. If this is OK, consider replacing it by ~.
L 1 (C 40): Input argument 'y' might be unused. If this is OK, consider replacing it by ~.
It would be nice if mlint had a "strict" mode that reported that w and v are undefined. I know I might later define functions w and v, but basically the way I program, 100% of the time it's a mistake on my part if I have undefined variables.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Variables についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!