How to convert my code block to recursive function?

2 ビュー (過去 30 日間)
Rooter Boy
Rooter Boy 2020 年 10 月 24 日
コメント済み: Stephen23 2020 年 10 月 24 日
"My code block does recursion. It's not a "recursive function", as in a function that calls itself, but it does implement a recursion. " I how to convert my code block to recursive function. Can you help me, please?

回答 (1 件)

Image Analyst
Image Analyst 2020 年 10 月 24 日
You need the first line to be
function newton() % Maybe with some arguments
then somewhere in newton, you need to call newton -- that's what makes it recursive. All you have now is a simple script m-file.

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by