Multiplying Vectors by a Matrix Entry-wise

  • Thread starter Thread starter jemma
  • Start date Start date
  • Tags Tags
    Matrix Vectors
Click For Summary

Discussion Overview

The discussion revolves around the concept of entry-wise multiplication of vectors by a matrix in a mathematical context. Participants explore the feasibility of performing such operations given the dimensional constraints of the vectors and the matrix involved.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents a scenario where they want to multiply a vector by a matrix entry-wise, providing specific examples of vectors and a matrix.
  • Another participant points out that the dimensions of the matrices involved do not match for entry-wise multiplication, questioning the validity of the operation as described.
  • A clarification is made regarding the intended calculations for specific entries in the resulting matrix, suggesting a different approach to align dimensions for multiplication.
  • A later post proposes modifying the vectors to match the dimensions of the matrix, indicating that this adjustment allows for the desired entry-wise multiplication to work correctly.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility of the initial multiplication approach due to dimensional mismatches. There is no consensus on a single method, as alternative approaches are suggested without agreement on the best solution.

Contextual Notes

The discussion highlights limitations related to matrix dimensions and the conditions under which entry-wise multiplication can be performed. Some assumptions about the operations and their implications remain unresolved.

jemma
Messages
35
Reaction score
0
Hi, this is probably a really simple problem but I'm trying to multiply vectors by a matrix, using entry-wise multiplication.
For example, I want to do something like this:

a = [1 2 3 4]
b = [5 6 7 8]'
c = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]

d = a.*b.*c

So that d is a 4x4 matrix and for example:

d(1,2) = 1*5*1 (etc.) So that each entry in the first row of d will be multiplied by b(1) and the corresponding a entry. Does this make sense? Anyway, is this possible?

Thanks!
 
Physics news on Phys.org
To use entry-wise multiplication the matrix dimensions must be the same, which they are not. a.*b is a 1x4 matrix and c is a 4x4 matrix.
I don't understand your second to last line because you seem to be explaining how to find d(1,2) by describing an operation on d itself.
 
Sorry, I meant to say, for example,
d(1,1) = a(1) .* b(1) .* c(1)
and,
d(1,2) = a(2) .* b(1) .* c(2)

I basically want to multiply each entry of every row of 'c' by 'b' then each entry of every column of 'c' by 'a'.
So isn't this possible since the dimentions are different?

I guess just making
a=[1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]
and
b=[5 6 7 8; 5 6 7 8; 5 6 7 8; 5 6 7 8]'
Then d = a.*b.*c works OK.
 
Last edited:
a = [1 2 3 4]
b = [5 6 7 8]'
c = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]
b*a.*c
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
7
Views
2K