The Fibonacci series is given as follow:
1, 2, 3, 5, 8, 13, 21, ...
How can I write a script file to calculate and print out the n-th Fibonacci term for n>2, where n is input by the user.
This is what I've tried:
n=input('n: ');
while(n < 3)
disp('must enter number >= 3')
if(n < 3)
fprintf('\n\n Please re-insert again!!\n')
n=input('n: ')
else (n >=3)
fibf(n)=fib(n-1)+fibf(n-2);
end
end
fprintf('the nth value of n is : ,fibf(n)')
but i didn't manage to print out the answer. WHY???