Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Zuy
Zuy am 29 Okt. 2018
Kommentiert: Zuy am 29 Okt. 2018
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

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 29 Okt. 2018
Bearbeitet: KALYAN ACHARJYA am 29 Okt. 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 Kommentare
Zuy
Zuy am 29 Okt. 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by