Filtering one array in a 1x4 cell
古いコメントを表示
I got a 1x4 cell containing 4 different trials. In each trial, the first array is a counter (from an encoder) and doesn't need filtering while the other array is forces which needs to be filtered. How do i access the second array of each trial in the cell, filter it, while keeping the data in a cell structure?

回答 (1 件)
Guillaume
2016 年 11 月 30 日
I assume by 1st and 2nd array, you actually mean column.
One possibility:
filtered_psn = cellfun(@(m) [m(:, 1), yourfilteringfunction(m(:, 2))], Psn, 'UniformOutput', false);
Or use a loop:
filtered_psn = psn;
for psnidx = 1 : numel(psn)
filtered_psn{psnidx}(:, 2) = yourfilteringfunction(filtered_psn{psnidx}(:, 2));
end
カテゴリ
ヘルプ センター および File Exchange で Discontinuities についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!