How would I implement a model of a recursive Fibonacci sequence on Simulink?

4 次查看(过去 30 天)
hi
I'm trying to understand Simulink and I wanted to know if anyone has implemented a Fibonacci sequence with a graphical diagram.
Apologies if this is not very clear. I mainly just want a visual representation of it because I am dyslexic.
Thanks
function fib = recursiveFibonaccifinal(N)
if N==0 % Termination condition no 1
fib = 0;
elseif
N==1 % Termination condition no 2
fib = 1;
else
fib = recursiveFibonacci(N-2)+recursiveFibonacci(N-1);
end
end

回答(0 个)

类别

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