how to multiply 3d matrix with 2d matrix

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

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 ?
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

H' * squeeze(y(p,q,:))

3 Comments

Thank you so much sir, i got the answer what i want. thank you for your valuable suggestion..
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
i'm sending snapshot of my result to you

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!