Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Zuy
Zuy el 29 de Oct. de 2018
Comentada: Zuy el 29 de Oct. de 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

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 29 de Oct. de 2018
Editada: KALYAN ACHARJYA el 29 de Oct. de 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 comentarios
Zuy
Zuy el 29 de Oct. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by