Re: MatLab help please!
Let's clarify a few things. First "x" is the array of inputs that you will plug into your Taylor series approximation. "N" is the number of Taylor series terms to use in your approximation (two, three, or four terms).
Now look at the general form of the Taylor series (thanks Wikipedia):
Instead of summing to infinity, you'll be summing up to "N", and "a" is the base point which equals 1. The last piece left in obtaining your approximation is f(n) which represents the n'th derivative of f(x) evaluated at "a". If your instructor didn't specify that your program should calculate the derivatives of ln(x), then don't do any extra work in doing so. Just work out the consecutive derivatives of ln(x) and plug in "a" for "x". I would create an array in the program to hold these values so you can piece together your approximation in a loop that repeats "N" times.
shwaip is right in that your factorial function should not be using your array "n". The factorial will be evaluated with the values 0 to N where N is the number of terms in your Taylor series.
If it were my program, I'd have two loops with one nested inside the other. The inner loop should go from 0 to N and sums up the terms of the Taylor approximation evaluated at "x". The outer loop should go from x = 0 to 2 with a step of 0.02.
I hope that helps.