Clear Filters
Clear Filters

How do i compile different variables into 1 variable?

1 view (last 30 days)
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);

Answers (1)

Image Analyst
Image Analyst on 12 Dec 2022
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:

Community Treasure Hunt

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

Start Hunting!