How to call an existing function 3 three times by creating an another function?

3 visualizaciones (últimos 30 días)
I already have a function which make a GUI.
I want to call this function by creating an another function . I want to call that three times. Do I need a for loop for that? If yes then how do I do it?
How to do that?
function gui_changed_color(task_no,fault_no_list,fault_no)
this is the function I already have.

Respuestas (1)

Navya Singam
Navya Singam el 12 de Jul. de 2021
Editada: Navya Singam el 12 de Jul. de 2021
Hi Praneethi,
function function_name()
for i = 1:3 % using a for loop to call the function
gui_changed_color(task_no, fault_no_list, fault_no) % here task_no, fault_no_list,fault_no are the parameters to be passed to gui_changed_color
end
end
Here gui_changed_color function is called 3 times using the for loop in the function_name. When the function_name function is called, it calls gui_changed_color function with specified parameters for 3 times , it calls gui_changed_color function with specified parameters for 3 times as i value increments by 1 each time and reaches till 3.
Refer to this documentation function for more information on function and for loop for more information on for loop.
Hope this helps.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by