フィルターのクリア

Display the input options for functions with multiple input arguments

24 ビュー (過去 30 日間)
Stephan
Stephan 2018 年 6 月 8 日
編集済み: Kodavati Mahendra 2018 年 6 月 8 日
Hi,
I have a function that takes more than one input argument - see my example where there are 2 arguments:
function z = example(x,y)
if nargin == 0
x = 1;
y = 1;
elseif nargin == 1
y = 1;
end
z = x + y;
end
The number of input arguments is flexible from 0 to 2. If there is no argument, put x and y equal to one. If there is only one input argument, let x assume the value of the input argument and y equal one. For both arguments x and y should accept the given value.
Using the function:
nargin
this part works. Now I have the question how I adjust the tooltip when entering so that the user is shown that he has several options. In my case he could call the function in 3 ways and there would be a result. To illustrate my question I have inserted two pictures:
.
.
You can see here, as it is at e.g. linprog works - mab gets displayed in the tooltip which variants the function can handle.
For my example, this does not work - here is only one variant that the user gets displayed, although 3 are possible:
.
.
From C # I know this procedure as overriding functions, but I know that there is not overriding in matlab in this form. How can I extend this tooltip to show all possible calls to my function as a tooltip?
.
Best regards
Stephan

採用された回答

Kodavati Mahendra
Kodavati Mahendra 2018 年 6 月 8 日
編集済み: Kodavati Mahendra 2018 年 6 月 8 日
I think they did not add this feature for R2018A
https://stackoverflow.com/questions/19413841/multiple-tooltip-input-suggestions-for-matlab-function

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by