How to save the values of variables during each iteration(for loop) in a single variable?
66 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Umaisa
el 28 de Oct. de 2022
Comentada: Umaisa
el 10 de Nov. de 2022
hello everyone.
i am extracting 4 features of audio signals and i need to save all values of each feature in each iteration in a single variable so that i can use it later.
thankyou.
0 comentarios
Respuesta aceptada
KALYAN ACHARJYA
el 28 de Oct. de 2022
Editada: KALYAN ACHARJYA
el 28 de Oct. de 2022
If output is numeric use Array
output=zero(1,total iteration); % Pre-allocate the variable
for iter i=1:...
output(i)=....Calculate here and save
end
If the output is vector or any group of numbers, use Cell Array
output=cell(1,total iteration); % Pre-allocate the variable
for iter i=1:...
output{i}=....Calculate here & save
end
Hope it helps!
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!