How to create a convolution matrix?

7 ビュー (過去 30 日間)
Thewall
Thewall 2014 年 4 月 13 日
回答済み: patricia torres 2019 年 4 月 27 日
Hello all,
I have a matrix like this
a=[1 2 3]
For convolution I reversed the matrix a=[3 2 1]
Then, to multiply this matrix with another matrix, I should shift the and get like this one
M=[1 0 0; 2 1 0; 3 2 1; 0 3 2; 0 0 3;]
How can I get this matrix ? Please help...

回答 (2 件)

Image Analyst
Image Analyst 2014 年 4 月 13 日
A for loop, and fliplr() and circshift() should get it for you. Give it a try first - it will be a good learning experience. It's not hard. Come back if it's too hard for you and you really really need us to do it 100% for you and it's not homework.

patricia torres
patricia torres 2019 年 4 月 27 日
M = convmtx(a,length(a));

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by