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 comentarios

Walter Roberson
Walter Roberson el 6 de En. de 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 ?
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

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de En. de 2016
H' * squeeze(y(p,q,:))

3 comentarios

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by