I have a recursive function that uses n, n-1, and n-2. I need to create a function that will return a vector or array of size 1x100, containing those function values. (Please help me figure out data type). It will take two initial values to start the function, and then return the array/vector.
If I create an array with zeros(1,100) at command line, set array(1) and array(2) with the initial values, and try to get it run on that, it at least generates some numbers. When I try this loop at command line with the same array, all the elements go either NaN or 0 >1E130.
I keep getting errors when I try modifying the array within the for loop. I don't understand how (better) to do this; I think I'm messing up the index accessing within the for loop.
Also, I'm not sure how to specify WHAT is being returned.
function [f] = recurs(a,b)