Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab: how to show user possible function inputs like Matlab does using help dropdown

Tags:

format

matlab

So in Matlab, if you start to type in a function like find( and then wait after the open parentheses, a small yellow popup will appear showing potential input options, like:

find(X)
find(X,K)
find(X,n,direction)
find(__)

So I'm wondering, is it possible to set up my own function so the same happens? I tried copying the find file in the format, so mine looks like this:

%MY_FUNCTION   Description of function
%   O = MY_FUNCTION(X) returns the output based on the input X.
%
%   O = MY_FUNCTION(X,Y) returns the output based on the input Y.

But after saving it, when I type my_function(, all it shows is my_function(...). Is it just not possible for user functions? Thanks for any input!

like image 558
sw_buddy Avatar asked Mar 04 '26 21:03

sw_buddy


1 Answers

It is possible to set up these hints for custom functions, but you can't do it in the function .m file. Instead, you need to put the information in a separate functionSignatures.json file in the same directory as the custom function. You can find the official documentation and file specification here.

like image 125
Mark Snyder Avatar answered Mar 07 '26 20:03

Mark Snyder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!