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 Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by