COS(2pix)
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Fawaz Hjouj
il 28 Ago 2019
Risposto: Fawaz Hjouj
il 31 Ago 2019
Hi ALL,
I needed the Taylor series ( about x=0) of cos[2*pi*x] for some application.
I wrote this little simple code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Xvalue= -10:.01:10;
Yvalue =zeros(1, length(Xvalue));
for w =1: length(Xvalue)
x0=Xvalue(w);
ss=0;
for mm = 0:100
ss=ss+ (-1)^(mm ) * ((2*pi*x0)^(2*mm)) / factorial(2*mm) ;
end
Yvalue(w)=ss;
end
figure(1)
plot(Xvalue, Yvalue)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I got the below figure, where after x is about =6, the y values started to be NAN.
comments please

0 Commenti
Risposta accettata
Walter Roberson
il 28 Ago 2019
for mm = 0:100
ss=ss+ (-1)^(mm ) * ((2*pi*x0)^(2*mm)) / factorial(2*mm) ;
What is (2*pi*6)^(2*100) ?
What is factorial(2*100) ?
What is the ratio of those two?
0 Commenti
Più risposte (2)
Fawaz Hjouj
il 28 Ago 2019
Modificato: Fawaz Hjouj
il 31 Ago 2019
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!