Date: Dec 9, 2012 1:42 PM
Author: soclydeza
Subject: Index excedes matrix dimensions

Here is my code for a loop that generates the Fibonacci sequence for the input values.

% Fibonacci
f(1) = input('Input first number in sequence ');
f(2) = input('Input second number in sequence ');
elem = input('Input number of elements ');
for j = 3:j
f(j) = f(j-1) + f(j-2);
Here's the thing, when I originally wrote this a few days ago it ran just fine for any input "elem" value up to 25. If I put in any number 25 or above, I got this message

Index exceeds matrix dimensions.

I opened it today, now it will only run for "elem" values 1 and 2, if I put 3 or above in I get the same thing,

Index exceeds matrix dimensions.

Error in Week10HW (line 35)

I did not change any of the code. Can somebody help me out, I'm kind of lost as to what this is about. Thanks.