こんにちは、元幹 井上さん、
私はあなたの質問に英語で回答します。
Looks like you want to parallelize the processing of time-series data within a specific interval, transferred from the oscilloscope by splitting it into equally spaced segments, parallelize the processing of each segment and obtain a vector for each process.
You can use the “parfor” loop in MATLAB to achieve the above goal. Please refer to the following example:
% Assuming you have the time-series data stored in a variable, let's call it 'data'
% Specify the number of segments to divide the data into
numSegments = 4; % Adjust this based on your requirements
% Calculate the number of data points in each segment
segmentSize = numel(data) / numSegments;
% Initialize a cell array to store the results from each segment
resultCell = cell(1, numSegments);
% Use parfor loop to process each segment in parallel
parfor i = 1:numSegments
% Calculate the start and end indices for the current segment
startIdx = round((i - 1) * segmentSize) + 1;
endIdx = round(i * segmentSize);
% Extract the current segment of data
currentSegment = data(startIdx:endIdx);
% Perform your processing on the current segment and store the result
resultCell{i} = yourProcessingFunction(currentSegment);
end
% Combine the results from all segments into a single vector
resultVector = vertcat(resultCell{:});
Make sure to replace “yourProcessingFunction” with the actual function or code that processes each segment of data.
Please refer to the following documentation to learn more about using “parfor” loop:
Hope it helps.