I can't write recursive function in Matlab (Please help me)

조회 수: 1 (최근 30일)
Rooter Boy
Rooter Boy 2020년 10월 23일
댓글: Stephen23 2020년 10월 24일
I tried many times but couldn't write a recursive function in Matlab. I don't know how to do it. My friends, I would be glad if someone could help me.
  댓글 수: 12
Rik
Rik 2020년 10월 24일
Just because you aren't getting the help you were hoping for dosn't make this question not appropriate, so I removed your flag.

댓글을 달려면 로그인하십시오.

답변 (1개)

Rik
Rik 2020년 10월 24일
In case you just want to know how to create a recursive function at all:
function n=I_call_myself(n)
disp(n)
if n>0
n=I_call_myself(n-1);
else
disp('n has reached 0')
end
end
  댓글 수: 8
Rooter Boy
Rooter Boy 2020년 10월 24일
Sir, I found solutions myself. This is advanced level coding. I want to delete these questions. If you help me about this topic, i will be happy.
Thanks for everything by the way.
Rik
Rik 2020년 10월 24일
Sorry, once you receive an answer it is considered rude to delete it, so the system will not allow you to do that. People with a similar question might find the posts here helpful.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by