Using two functions in a loop

조회 수: 2 (최근 30일)
Vahagn
Vahagn 2023년 4월 10일
답변: KALYAN ACHARJYA 2023년 4월 10일
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?

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2023년 4월 10일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by