フィルターのクリア

When overloading a builtin function: can I copy the original signature to allow auto-complete?

2 ビュー (過去 30 日間)
royk
royk 2022 年 7 月 19 日
回答済み: Ramtej 2023 年 9 月 5 日
Say I define my own implementation for the plot function:
function varargout = plot(varargin)
% do my own stuff
% ...
% call the builtin function:
[varargout{1:nargout}] = builtin('plot', varargin{:});
end
It all works fine, except that the new function does not auto-complete.
Can I copy the signature of the built-in function to my new function to allow auto-complete?

回答 (1 件)

Ramtej
Ramtej 2023 年 9 月 5 日
Hi royk,
I assume "new function does not auto complete" means that MATLAB does not auto complete the name of your function.
The auto completion does not work because your new function definition file is not in the MATLAB path.
Add the folder of new function to the MATLAB path, then auto complete should work.
You can refer to the Function Precedence Order when you are calling the overloaded function.
Hope this resolves your query!

カテゴリ

Help Center および File ExchangeManage Products についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by