Run a function with input arguments using App Designer
34 ビュー (過去 30 日間)
古いコメントを表示
Rishi Balasubramanian
2020 年 12 月 31 日
コメント済み: Mario Malic
2020 年 12 月 31 日
I have a MATLAB script file (.m file) which is a function
%It begins like this
function M = qcldpc(j, k, a, b, p)
I am trying to create an application that can run multiple of such .m files using app designer.
I want to get the input parameters from the user to be run in the function file. How do I do this. I am brand new to app designer and would love some pointers. Thank You
2 件のコメント
Mario Malic
2020 年 12 月 31 日
If you do the few examples that are available in App Designer, you'll get an idea what do you need to do.
採用された回答
Mario Malic
2020 年 12 月 31 日
Great work, thank you for doing those.
You can set your variables into the property of the app and you'll be able to use those in other callbacks, functions etc. Public properties allow access to their values outside of app, private do not.
% Verify if properties block is correctly written
properties (Access = private)
M
end
function CreateButtonPushed(app, event)
j = app.RowjEditField.Value;
k = app.ColumnkEditField.Value;
a = app.oaEditField.Value;
b = app.obEditField.Value;
p = app.SizeofIxEditField.Value;
[B, app.M] =qcldpc(j, k, a, b, p);
app.UITable.Data = B;
end
function SimulateButtonPushed(app, event)
db = app.SNRLimitEditField.Value;
it = app.IterationsEditField.Value;
msg = Final(M,db, it);
end
2 件のコメント
Mario Malic
2020 年 12 月 31 日
Also, a warm reminder from all of us here, don't use eval. Have a great day.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!