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!