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 回表示 (過去 30 日間)
古いコメントを表示
Sai Prakash Reddy Konda
2018 年 9 月 8 日
コメント済み: Sai Prakash Reddy Konda
2018 年 10 月 3 日
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 件のコメント
採用された回答
Image Analyst
2018 年 9 月 8 日
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 件のコメント
その他の回答 (1 件)
Walter Roberson
2018 年 9 月 8 日
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
参考
カテゴリ
Help Center および File Exchange で Filter Design についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!