Plotting summation using for loop
Mostra commenti meno recenti
How would I plot values of i for 1,2,3,4,5 individually on the same graph?
x = -pi:0.1:pi;
ye = cos(x);
n = length(x);
summe = 0.0;
for i = 1:n
summe = summe +((-1).^(i)).*((x.^(2.*i))./(factorial(2.*i)));
end
hold on
plot (x, summe);
plot (cos(x), ye)
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Graphics Performance in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!