From: Rock Bean on
|.| that is the modulus sign.
i am trying to solve that question using M-file...
that is the question that was given to me and i am trying to solve it....
i think in this case i need to find a way how to generate the first 100 terms of f(n+1) when f(0) = 1 and f(1) = -2

im not sure if this made it any clearer
From: dpb on
Rock Bean wrote:
> |.| that is the modulus sign.
> i am trying to solve that question using M-file...
> that is the question that was given to me and i am trying to solve it....
> i think in this case i need to find a way how to generate the first 100
> terms of f(n+1) when f(0) = 1 and f(1) = -2
>
> im not sure if this made it any clearer

For starters, your posting "code" isn't in the proper syntax for a
Matlab function. Start w/ the "Getting Started" section on m-files and
look at the examples as well as

doc function

Of course, you have to decided from the problem assignment what are
inputs to the function ("m-file") and the desired output which is,
coincidentally, the part of the task that requires thought about what it
is you're actually trying to do...

After that, the rest is mechanics of implementing what you would do w/
pencil and paper to solve the same question in a manner Matlab
understands...

--