Using functions in functions

1 Ansicht (letzte 30 Tage)
Adham Elkhouly
Adham Elkhouly am 11 Mai 2020
Kommentiert: Ameer Hamza am 11 Mai 2020
In MATLAB App designer,
I am trying to learn how to create a private function and use it in another callback function (let's say of a certain button).
I created the function, but I have trouble setting the parameters and calling it in the other callback function.
In C++ code,
int product (int num1, int num2)
{
int result;
result = num1*num2;
return result;
}
void another function()
{
int num1;
num1 = 2;
int num2;
num2 = 3;
int x = product(num1,num2);
return;
)
My MATLAB private function only computes 1 value (an array) and need to return this array when called.
Can someone please help?
Thank ypu

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 11 Mai 2020
Check the code in the attached app to see how to define and use private functions in App-designer.
  2 Kommentare
Adham Elkhouly
Adham Elkhouly am 11 Mai 2020
Thank you so much
Ameer Hamza
Ameer Hamza am 11 Mai 2020
I am glad to be of help.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by