Using two functions in a loop

1 visualizzazione (ultimi 30 giorni)
Vahagn
Vahagn il 10 Apr 2023
Risposto: KALYAN ACHARJYA il 10 Apr 2023
Hi,
I want to use two functions in a loop in a way that the second function is activated only when the first function returns an error message. How can I do that?

Risposta accettata

KALYAN ACHARJYA
KALYAN ACHARJYA il 10 Apr 2023
iter=1;
for i=1:iter
try
fun1(3,8)
catch
fun2(4,6)
end
end
function z=fun1(a,b)
z=a.b
end
function z1=fun2(c,d)
z1=c+d;
end

Più risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by