hi i'm a 1st year engineering student. and there is this problem which i cant to at all.. can someone help me out.. or atleast start me off in the right direction this is the question Any function can be expanded as a power series, a fact that is widely used in numerical analysis. For example the exponential function can be expected to give e^x = 1 + x + x^2/2! + x^3/3! + x^4/4! + ..... using a for loop. write a matlab program that computes approximations to e^x using the 1st n terms of the power series expansion. THe values of x and n should be fed in from the keyboard. can someone help m
prompt the user of x and n using something like: n=input('n=') the for loop should look like for k=1:n your series statement with n and x variables end
is this from a specific matlab book? Is the Gilat one? If so, and you know what number question it is, I can give you the answer
no its an assignment ,, i dont know which book
Hello My Dear Friend, @sab11 WelcoMe To OpeN studY !! I'm not a professional in Matlab, why not have a look at http://www.mathworks.in/matlabcentral/newsreader/view_thread/53134 , Does this helps ? Hope, if U Are Satisfied with this answer, Please Close This Question ! Thank U !! Keep In Touch, with Open study !!
Hmm... I just gave a Try ! function e = evaluation(x,n) e = 0; for k = 0:n e = e + x^k/factorial(k); end end Also, x=input('Enter x: '); n=input('Enter n: '); e = 0; for k = 0:n e = e + x^k/factorial(k); end end It prompts for x and n and then display the result. please Check it, i too got confused while recalculating ! Thank U !! Keep In Touch, with Open study !!
Join our real-time social learning platform and learn together with your friends!