Filtering a matrix column with different cutoff

Illustration
Francisco - 2021-02-02T10:31:02+00:00
Question: Filtering a matrix column with different cutoff

I’ ve looking for a method to filter each column of data (101X62) with specific cutoff (1X63). Please, could someone indicate me the problem? Thanks    x=data fs=60; fc=cutoff; for idx = 1:numel(x); [b,a] = butter(2, fc/(fs/2)); y = filter(b,a,x); %// output end  

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

Perhaps you meant this:
 
 
[rows, columns] = size(data);
y = zeros(size(data));
fs = 60;
for k = 1 : columns
  thisColumn = data(:, k); % Extract this one column
  fc = cutoff(k); % Extract this one cutoff value.
  % Determine filter parameters.
  [b,a] = butter(2, fc/(fs/2));
  % Do the filtering, and put result into column k of the output y
  y(:,k) = filter(b, a, thisColumn);
end


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!