Hi, I have a matrix 1664 × 128. How to design a filter, the output of the filter is 832×128. That is, it should have first half of 1664(i.e. 832) and should remove other part. I know that I can use: (1:832,:). But I want to design a filter for it.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Sai Prakash Reddy Konda
il 8 Set 2018
Commentato: Sai Prakash Reddy Konda
il 3 Ott 2018
Hi, I have a matrix 1664 × 128. How to design a filter, the output of the filter is 832×128. That is, it should have first half of 1664(i.e. 832) and should remove other part. I know that I can use: (1:832,:). But I want to design a filter for it.
0 Commenti
Risposta accettata
Image Analyst
il 8 Set 2018
Not sure what you want. Do you want a filter that returns the matrix unaffected on the top half and the bottom half is all zeros, or cropped off entirely? Or something else?
To zero:
function filteredM = MyFilter(M)
filteredM = M; % Initialize
filteredM(833:end, :) = 0
To crop
function filteredM = MyFilter(M)
filteredM = M(1:832, :);
If that's not what you mean, then explain better.
2 Commenti
Più risposte (1)
Walter Roberson
il 8 Set 2018
Filters always return an output the same size as the input, so this is not something that can be done as a true filter.
It can be done as an anonymous function
F = @(M) M(1:floor(end/2),:);
In the case of a matrix with an odd number of rows this does not copy the center row. If you want the center row copied then use ceil instead of floor
Vedere anche
Categorie
Scopri di più su Filter Design in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!