Matrix Multiplication is possible???
Mostrar comentarios más antiguos
Hi Can i programm under matlab Matrix multiplication generally without use of general entries
C = A*B is the linear algebraic product of the matrices A and B. If A is an m-by-p and B is a p-by-n matrix
Thanks
Respuestas (4)
Azzi Abdelmalek
el 15 de Ag. de 2013
C=A*B
1 comentario
Andrew Reibold
el 15 de Ag. de 2013
lol, so complicated!
Image Analyst
el 15 de Ag. de 2013
0 votos
What are "general entries"? If you want the matrix multiplication, simply do C=A*B like you said. If you want element-by-element multiplication, do C=A.*B. So I'm not sure what you're asking. Did you actually try C=A*B like you said - it's easy enough to do. If so, was there something unexpected that you observed?
Marwen
el 15 de Ag. de 2013
0 votos
3 comentarios
Image Analyst
el 15 de Ag. de 2013
No, I don't. I don't even see a question in your "Answer" - do you have one? Or are you just making a comment or letting us know that you are willing to develop simple examples for people to solve their problems? Perhaps you can create a new discussion and in there ask a question, if you have one. http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Marwen
el 15 de Ag. de 2013
Editada: Azzi Abdelmalek
el 15 de Ag. de 2013
Image Analyst
el 15 de Ag. de 2013
OK. I'm going to assume that the code you gave does what you want to do. I still don't see a question here, so I guess we're done.
Azzi Abdelmalek
el 15 de Ag. de 2013
Editada: Azzi Abdelmalek
el 15 de Ag. de 2013
A=randi(10,5,6); % Example
B=randi(10,6,7);
p=size(A,2);
C=@(i,j) sum(A(i,:)'.*B(:,j))
% If i=2 and j=6 use
C(2,6)
Which is the same as
C=A*B
C(2,6)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!