Too many output arguments - appdesigner

5 ビュー (過去 30 日間)
URDEA
URDEA 2023 年 1 月 19 日
コメント済み: URDEA 2023 年 1 月 19 日
I have some problems...
A little context: in my project I need a menu bar named "syntax" and two sub-menus (one with treeplot(p) syntax and one with treeplot(p,nodeSpec, edgeSpec) syntax) and a button named " result" which, when I click, will build a tree graph taking into account the syntax selected from the menu bar and also the other properties.
My problem is that, when I select the type of syntax from the sub-menu, it directly draws the graph, which is not good, because the drawing of the graph must be done after pressing the button named "result". in the code below, I tried to assign to the "wave" variable: 1 if the first sub-menu is selected or 2 if the second sub-menu is selected and put it in the code of the function of the button named "result".
% Menu selected function: SintaxeMenu
function SintaxeMenuSelected(app, event)
if(app.treeplotpMenuSelected.Text) %here i get "Too many output arguments" error
app.val=1;
else
if(app.treeplotpnodeSpecedgeSpecMenuSelected.Text) %here i get "Too many output arguments" error too
app.val=2
end
end
I assigned 1 or 2 to the variable "wave" to be able to specify somehow in the function of the button called "result" that "if the submenu with the syntax treeplot(p) is selected, then do these conditions" thing
function RezultatButtonPushed(app, event)
app.p=str2num(app.pEditField.Value)
if (app.val==1)
treeplot(app.p)
else
if(app.val==2)
treeplot(app.p,app.nodeSpecDropDown.Value,app.edgeSpecDropDown.Value)
end
end

回答 (1 件)

Hans Scharler
Hans Scharler 2023 年 1 月 19 日
It looks like you are trying to figure out if treeplotpMenuSelected is selected. You need to check it's Value property.
function SintaxeMenuSelected(app, event)
if(app.treeplotpMenuSelected.Value == 1)
app.val=1;
else
if(app.treeplotpnodeSpecedgeSpecMenuSelected.Value == 1)
app.val=2
end
end
  1 件のコメント
URDEA
URDEA 2023 年 1 月 19 日
but " Too many output arguments " error still appears...

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

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by