Help with Matlab Question

edited September 2009 in Internet & Media
Show that the limit as x approaches 0 (e^x - 1) / x = 1

Do this by first creating a vector x that has some elements: 1 .5 .1 .01 .001 .00001 .0000001. Then create a new vector y in which each element is determined from the elements of x by (e^x - 1)/x . Compare the elements of y with the value 1 (use format long to display the numbers)


I put this in

x = [ 1 .5 .1 .01 .001 .0001 .0000001 ]
y = (exp(x)-1)/(x)

But it only returns when x= 1

I'm new to Matlab

Comments

  • MyrmidonMyrmidon Baron von Puttenham California Icrontian
    edited September 2009
    When using matrix math, you need to use matrix operators.

    The / sign is a linear operator. Try using ./ instead of /
  • edited September 2009
    Thank you, ugh, always have problems with small things like that. Thank you!
Sign In or Register to comment.