フィルターのクリア

sending values from function to appdesigner

1 回表示 (過去 30 日間)
Furkan Karaman
Furkan Karaman 2023 年 3 月 27 日
コメント済み: Furkan Karaman 2023 年 4 月 6 日
I have a function which should be executed if a button is pressed and two values should be returned
in function file:
function [x,y] = MySimple_Edgee(res,ch,thres,edg,ac_coup,dc_coup,range,analog_offset)
in app file:
[app.a,app.b]=MySimple_Edgee(app.Resolution,app.Channel,app.Threshold,app.Edge,app.AC,app.DC,app.Range,app.anOffset;
plot(app.UIAxes,app.a,app.b);
error message is given: Too many output arguments
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 3 月 27 日
Is it somehow possible that app is non-scalar at that point so app.a would be expansion ?

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

回答 (1 件)

chrisw23
chrisw23 2023 年 3 月 28 日
To call your function saved as a script from appdesigner just place the script file in a folder named 'private' that has to be placed beside the *.mlapp file (just to be in path). The syntax will be
[x,y] = MySimple_Edgee(res,ch,thres,edg,ac_coup,dc_coup,range,analog_offset)
To integrate the function in your mlapp app save it as private function
function [x,y] = MySimple_Edgee(app,res,ch,thres,edg,ac_coup,dc_coup,range,analog_offset)
and call it like
[x,y] = app.MySimple_Edgee(res,ch,thres,edg,ac_coup,dc_coup,range,analog_offset)
  1 件のコメント
Furkan Karaman
Furkan Karaman 2023 年 4 月 6 日
thank you for your detailed answer but it worked somehow with my method

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

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by