How to configure tab completion for my function in MATLAB 2016 ?

27 ビュー (過去 30 日間)
CY Y
CY Y 2016 年 10 月 7 日
回答済み: Ken Atwell 2018 年 8 月 13 日
In older version of MATLAB, automatic tab completion can be configured through editing TC.xml located in \matlabroot\toolbox\local\. In MATLAB 2016, however, this file no longer exists. How I can configure tab completion for my own function in MATLAB 2016 then ?

採用された回答

Joe Yeh
Joe Yeh 2016 年 10 月 7 日
As it turns out, MATLAB 2016 uses a functionSignatures.json file to configure automatic tab completion. One can easily read the content of any such file you find within the $matlabroot\toolbox\ folder to understand how it works.
Here is a very simple example functionSignatures.json file showing how to set up tab completion for a function named nd2finfo :
{
"nd2finfo":
{
"inputs":
[
{"name":"nd2file", "kind":"required", "type":"filepath=*.nd2" }
]
}
}
This file should be saved within the same folder that has the function definition. While typing in the function input, upon pressing tab, I can see a list of files with the extension .nd2 popping up.
  1 件のコメント
Abhinav Gaur
Abhinav Gaur 2017 年 1 月 19 日
What should be the permissions setup on this file?

サインインしてコメントする。

その他の回答 (1 件)

Ken Atwell
Ken Atwell 2018 年 8 月 13 日
Note that, as of R2018a, this capability is documented and supported. See Customize Code Suggestions and Completions

カテゴリ

Help Center および File ExchangeSource Control Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by