fibonacci series in matlab
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
the cyclist
2015 年 11 月 23 日
編集済み: the cyclist
2015 年 11 月 23 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Search Path についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!