フィルターのクリア

How to save the values of variables during each iteration(for loop) in a single variable?

66 ビュー (過去 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.

採用された回答

KALYAN ACHARJYA
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 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2022 年 10 月 28 日
Thank you @John D'Errico for additional note.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by