How to implement function hints in your code
51 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
D. Plotnick
il 1 Mag 2017
Commentato: Travis Bemrose
il 6 Mar 2020
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;
addParameter(p,'mult',2)
parse(p,varargin{:})
out = in*p.Results.mult;
end
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 Commento
Rik
il 1 Mag 2017
This is indeed an interesting question. (this comment is mostly to get in on my watch list)
Risposta accettata
Kevin Gleason
il 4 Mag 2017
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 Commenti
breathi
il 2 Gen 2020
Jan/Steven,
is there now a solution (maybe even with functionSignatures) for what Jan mentioned?
See also my question with point 2: https://de.mathworks.com/matlabcentral/answers/495677-how-to-generate-the-custom-help-box-for-a-custom-function-more-help?s_tid=es_ans_avr_que_view
Regards
Travis Bemrose
il 6 Mar 2020
Is there an update on this? Still looking for a solution:
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Historical Contests in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!