Here is a simple function I created to generate the nth Fibonacci number:
function []=Fib(n)sn(1) = 1;sn(2) = 1;for i=3:n sn(i)=sn(i-1)+sn(i-2);end sn(n)end
So Fib(5) give me ans = 5 However, when I try to execute "Fib(5)*2" I get the message "Too many output arguments" This is really really basic stuff, but I have no idea how to work Matlab and would appreciate some help. Thanks
Best Answer