How to call an existing function 3 three times by creating an another function?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
Navya Singam
le 12 Juil 2021
Modifié(e) : Navya Singam
le 12 Juil 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.
0 commentaires
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!