how to multiply 3d matrix with 2d matrix

1 view (last 30 days)
i have one matrix 'H' with dimension of 2976 X 2976 and another one is 'Y' of 2 X 2 X 2976 and how to get another matrix with multiplication of H and Y and also i'm using for loop for this as it is related to computation of algorithm considering a whole image. I'm getting error of "Inputs must be 2-D, or at least one input must be scalar".
  2 Comments
Walter Roberson
Walter Roberson on 6 Jan 2016
What output size are you hoping for?
Are you trying to do algebraic matrix multiplication? If so then are you wanting H*Y or Y*H ?
Akshay_Gattawar
Akshay_Gattawar on 6 Jan 2016
output size should be of 3D, but getting problem in multiplication and i want H'*Y. I'm forwarding my code. First is H is circulant matrix of dimension 2976 X 2976 and y is 2 X 2 X 2976 matrix of pixel information of image. After this code i'm getting error as mentioned earlier.
% code
for p=1:2
for q=1:2
%Projection(p,q,:) = H'*y(p,q,:);
end
end

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 6 Jan 2016
H' * squeeze(y(p,q,:))
  3 Comments
Akshay_Gattawar
Akshay_Gattawar on 11 Jan 2016
hell sir, i follow as per your instruction but due to use of squeeze function i'm getting correct values at first running of code but after first running code if i again run code i got different values i.e values vary at every time if i run code. please tell me how to solve this problem

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!