フィルターのクリア

uicontextmenu callback function number of arguments error?

5 ビュー (過去 30 日間)
Rafet
Rafet 2014 年 12 月 13 日
回答済み: Rafet 2014 年 12 月 14 日
Hi,
I'm trying to add a context menu to a contourf plot and i want its callback to plot the contourf in a new figure. Actually i achieved my goal in a different way but i'm wondering about the "too many inout arguments" error i encountered with the code below:
uic=uicontextmenu;
uimenu(uic,'Label','Plot in new figure','Callback',{@plotveldistinnewfig,i0,il,j0,jl,secZ,pv});
I created a function which plots in a new figure named as "plotveldistinnewfig" and it needs 6 input arguments, but when i try to run the code above it gives the error "too many input args"
Is there something wrong with my code?
Thanks,
Rafet

採用された回答

Rafet
Rafet 2014 年 12 月 14 日
I found my answer in this link:
while creating your function, you must first define "hObject and callbackdata" as first and second inputs, then write other inputs.
For example, my plotinnewfig function must be like that;
function(hObject,callbackdata,var1,var2,varn)
%do the action
end
I hope this answer would be beneficial to anybody in my situ.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by