필터 지우기
필터 지우기

How do i compile different variables into 1 variable?

조회 수: 1 (최근 30일)
Bazil Faisal
Bazil Faisal 2022년 12월 12일
답변: Image Analyst 2022년 12월 12일
Hi. I'm trying to compile different values of summation into variable, test_D3.
What's going on is, I use for loop to apply the max function on different values of LoadFile1. After, I save the result in test_D3 variable. Problem is, I would like to compile each diffrent results of test_D3 into 1 new variable.
for j = 1:1:5
% Define files to process
sprintf('Current H File Creation for Digging (N=100), N = %d',j)
File1 = 'GFGD_Jumping_All_%d_01-Jul-2022.mat'; %'GFGD_Walking_Filter_%d_14-Jan-2022.mat'
WavFile1 = sprintf(File1,j);
LoadFile1= importdata(WavFile1);
% Apply 'max' function on GFCC file and store the result in a new cell (summation) consecutively
summation = max(LoadFile1);
test_D3 = vertcat(summation);
end

답변 (1개)

Image Analyst
Image Analyst 2022년 12월 12일
What is LoadFile1?
whos LoadFile1
Isn't the max value of it a scalar? If so why don't you just do this
test_D3(j) = summation;
If you have any more questions, then attach your data (at least 2 mat files) with the paperclip icon after you read this:

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by