필터 지우기
필터 지우기

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by