fibonacci series in matlab
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
function f = fibnum(n)
% fibnum Fibonacci number
% fibnum(n) generates the nth Fibonacci number
if n <= 1 f = 1;
else f = fibnum(n-1) + fibnum(n-2);
end
Geting error when I type in command window
>> fibnum(12)
Undefined function or variable 'fibnum'.
0 Commenti
Risposte (1)
the cyclist
il 23 Nov 2015
Modificato: the cyclist
il 23 Nov 2015
I'm guessing that the function is not on the search path (where MATLAB will look for functions to execute).
What is the result of
which fibnum
?
0 Commenti
Vedere anche
Categorie
Scopri di più su File Operations 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!