Using F1 for help, gives help for wrong function
2 ビュー (過去 30 日間)
古いコメントを表示
Consider this code snippet:
plot(x, y1); % 2D line plot
hold on;
plot(x, y2); % 2D line plot
plot(p); % polyshape plot
When I click in the first "plot" above and press F1, a help window appears with the documentation for the 2D line plot function. That's great.
However, when I click in the third instance of "plot" and press F1, the same documentation appears. That's a problem since this function is the polyshape plot function, not the 2D line plot function. Seems to me the MATLAB IDE should have enough context to figure out which documentation to open... or am I missing something here?
0 件のコメント
回答 (1 件)
Steven Lord
2021 年 10 月 7 日
Does the variable p exist in the workspace when you ask for help? It's not sufficient that the code to create that variable as a polyspace exists in your file. You don't want MATLAB to run your code when you press F1 to determine which overload's documentation to display. [What if hold or the first calls to plot assigned a new value to p, meaning when that line gets executed or won't do what static analysis of the code said it should?]
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!