Azzera filtri
Azzera filtri

How can i keep the results of for loop iteration in every step

2 visualizzazioni (ultimi 30 giorni)
I am trying to calculate a sum series. Series upper limit chance btw 4:2:16 and i want to keep for loop iterations in an array cause i will make a plot N vs Stot.
syms j
for N=4:2:16
S(i)=(symsum(cos((20*pi*j)/(N+1)),j,0,N))
Stot=(2*pi/(N+1))*S;
double(Stot)
end

Risposta accettata

KALYAN ACHARJYA
KALYAN ACHARJYA il 29 Ott 2018
Modificato: KALYAN ACHARJYA il 29 Ott 2018
use
slot(i)=(2*pi/(N+1))*S;
Example:
for i=1:10;
k(i)=2+i;
end
Command Window
>> k
k =
3 4 5 6 7 8 9 10 11 12
  6 Commenti
Zuy
Zuy il 29 Ott 2018
i am using S1 formula. İ want to chance N like N=4:2:16 it is 10 in this case but at the same time i want to keep all of summation results in an array cause i will make a plot from them.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices 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!

Translated by