MATLAB Answers

How to implement function hints in your code

조회 수: 58(최근 30일)
D. Plotnick
D. Plotnick 2017년 5월 1일
댓글: Travis Bemrose 2020년 3월 6일
I have seen that this has been asked previously, but never answered, and I want to know if this should go in as a feature request or if the capability is just not obvious.
When one starts typing e.g. 'plot(' and then waits, a series of suggested completions pops up. If I try this on my own code, it simply bases the suggestion on the top line. An abstract MWE example:
function out = foo(in, varargin)
p = inputParser;
out = in*p.Results.mult;
The function hint for this is 'foo(in,...)'.
Now, if I have a large number of possible inputs (similar to plot), I instead want the function hint to display some custom combinations of possible inputs as opposed to the single line based on the function definition. Preferably this would be based directly off of the comment header in the function file, although I could see it using an external file as well. This would be extremely helpful for building toolkits for other users.
Is this now possible? If not, I will submit it as a feature request.
Cheers, -Dan
  댓글 수: 1
Rik 2017년 5월 1일
This is indeed an interesting question. (this comment is mostly to get in on my watch list)

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

채택된 답변

Kevin Gleason
Kevin Gleason 2017년 5월 4일
As of MATLAB R2017a, this feature is not available.
I have submitted a feature request on your behalf. The development team is aware of the issue and may consider adding it in a future release.
  댓글 수: 6

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

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by