How to save the values of variables during each iteration(for loop) in a single variable?
51 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
KALYAN ACHARJYA
2022-10-28
编辑:KALYAN ACHARJYA
2022-10-28
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!