I'm trying to make a taylor series expression for e^x = sum(x^n/n!) for n=0:50 and for x^n/n!>0.01 So far I have this:
function [ xs ] = myExpfuntion(x)
x=input('Enter x: ');
for n= 1:50
xl(n+1) = ((x^n)/factorial(n));
I want to delete the line "x=input('Enter x: ');" and just place my value for x in the function i.e. myExpfunction(x) and also make the function work with x being a row vector i.e x=[1 2 3]
My current function wont allow me to do so and I don't get what I'm doing wrong. Please help!