fibonacci series in matlab
조회 수: 1 (최근 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에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!