Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

write a mfile with matlab which takes a and n from user and gives the n term s of taylor series of sin(x) around x=a

Mathematics
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

i have difficulties with math part @experimentX
we must print something like this\[a_0+a_1(x-a)+a_2(x-a)^2+...\]
man i have nothing :(

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Woops ... !! probably write a function do do that.
syms x diff(sin(x), 'n times differentiate', 'around a');
man would u mind to join us :)
Woops!! lol
lol
nth derivative of sin(x)\[\sin(\frac{n\pi}{2}+x)\]
wrong !!!
Woops ... i need to differentiate it and substitute it.
clc syms x center = input('Enter the center of expansion: '); for i=1:10 disp(subs(diff(sin(x), i), x, center)); end
exper can we show that like what i mentioned above?
for example with center 3 -0.9900-0.1411(x-3)+0.9900(x-3)^2+...
hold on ... I'm working.
I don't like Matlab's string handing !!
me too
  • phi
This does not do the input. But it does give an idea a=pi/3, n=4; str2=''; for ii=0:(n-1) switch mod(ii,4) case 0, ff= sin(a); case 1, ff= cos(a); case 2, ff= -sin(a); case 3, ff= -cos(a); end; if (ff<0) sg= '-' else sg= '+'; end; if ii>0 str= sprintf('%2s %7.5f(x-%2.4f)^%d',sg, abs(ff)/factorial(ii),a,ii); else str= sprintf('%7.5f',ff); end; str2= [str2 str]; end; str2
  • phi
its output str2 = 0.86603 + 0.50000(x-1.0472)^1 - 0.43301(x-1.0472)^2 - 0.08333(x-1.0472)^3
I really hate matlab for string manipulation clc syms x center = input('Enter the center of expansion: '); for i=1:3 disp( [subs(diff(sin(x), i), x, center), strcat('(x-', num2str(center), ')^', num2str(i))]); end
I got this nasty code ... looks pretty close clc syms x center = input('Enter the center of expansion: '); to_out = ''; for i=1:10 to_out = strcat(to_out, '+' , strcat(char(subs(diff(sin(x), i), x, center)), strcat('(x-', num2str(center), ')^', num2str(i)))); end disp(to_out);
the out put is ...for r=4 ... maybe tweak a little. +cos(3)(x-3)^1+-sin(3)(x-3)^2+-cos(3)(x-3)^3+sin(3)(x-3)^4
thank u guys

Not the answer you are looking for?

Search for more explanations.

Ask your own question