I am not sure what is wrong with my code, here is the prompt:
Write a function called e_to_the_x to estimate using its Taylor series:
starting with n =0, add terms until 2 subsequent approximations differ by less than using a while loop. (HINT: use the built-in function factorial()).
I am getting values but when I call e_to_the_x(-1) and e_to_the_x(1) it says I have incorrect values. Here is my code:
function [y1,y2] = e_to_the_x(x)