Is there such a matrix operation

  • Thread starter Wolfgang2b
  • Start date
  • Tags
    Matrix
In summary, the conversation discusses two matrices, A and B, with A being a 1 x 6 row vector and B being a 1 x 3 row vector. The number of elements in B is equal to the number of 1s in A. The person is looking for a matrix operation, similar to A*B, that would give a resulting matrix C with the 1s in A replaced by the values in B and the zeros left as they are. They specify that they do not want to access the individual elements separately. The conversation also mentions the use of LaTeX for writing mathematics and the relevance of knowing what a matrix is.
  • #1
Wolfgang2b
31
0
Say I have two matrices of the form

A = [1 0 0 1 0 1] (1 x 6 row vector)

and

B = [ a b c] (1 x 3 row vector). The number of elements in B = number of 1s in A.

Is there any matrix operation that could be done on A and B that would give me C = [a 0 0 b 0 c]? That is the 1's of A should be replaced with the values in B and zeros left as it is.

I am looking for operations that would not access the individual elements separately (i.e. I am not looking for things like if A(1)==1, C(1)=A(1)*b(1) etc... or inserting zeros.) I am looking for some operation like A*B that would give this result.

Sorry about the cryptic title. I can't really describe it without examples.
 
Last edited:
Physics news on Phys.org
  • #2
Wolfgang2b said:
Say I have two matrices of the form

A = [1 0 0 1 0 1]


Either this is a [itex]\,1\times 6\,[/itex] matrix, which is the same as a six-coordinate row vector, or you meant something else

that I, at least, cannot imagine what it is.

and

B = [ a b c]. The number of elements in B = number of 1s in A.


The same as above. Do you know what a matrix is? You should also know we have LaTeX in this site for us all to

properly write mathematics. This would be a huge improvement in this kind of question.

DonAntonio


Is there any matrix operation that could be done on A and B that would give me C = [a 0 0 b 0 c]? That is the 1's of A should be replaced with the values in B and zeros left as it is.

I am looking for operations that would not access the individual elements separately (i.e. I am not looking for things like if A(1)==1, C(1)=A(1)*b(1) etc... or inserting zeros.) I am looking for some operation like A*B that would give this result.

Sorry about the cryptic title. I can't really describe it without examples.
 
  • #3
DonAntonio said:
Either this is a [itex]\,1\times 6\,[/itex] matrix, which is the same as a six-coordinate row vector, or you meant something else

that I, at least, cannot imagine what it is.

Yes, it is a 1 x 6 row vector or you can take the transpose and consider it a 6 x 1 column vector. Doesn't really matter. Same for the other matrix.
DonAntonio said:
Do you know what a matrix is? You should also know we have LaTeX in this site for us all to

properly write mathematics. This would be a huge improvement in this kind of question.

DonAntonio
I know there was a matrix with Keanu Reeves in it. Like that one actually. I also have done few problems with the matrices in math. I don't know why this is relevant here. Can't I call row vectors as matrices? I store them as matrices in Matlab and would like to do matrix operations.

I also don't see the need to write this question in LaTeX as it does not contain any complex equations that would otherwise be unintelligible. However I would do that in future questions. For now, I will update the OP.
 

FAQ: Is there such a matrix operation

What is a matrix operation?

A matrix operation is a mathematical operation performed on matrices, which are rectangular arrays of numbers or symbols. These operations include addition, subtraction, multiplication, and division.

What are the properties of a matrix operation?

The properties of a matrix operation include commutativity, associativity, and distributivity. Commutativity means that the order in which matrices are multiplied does not affect the result. Associativity means that the grouping of matrices being multiplied does not affect the result. Distributivity means that multiplication of a matrix by a scalar can be distributed over addition of matrices.

How do matrix operations differ from regular arithmetic operations?

Matrix operations differ from regular arithmetic operations in the way that they are performed. While regular arithmetic operations are performed on individual numbers, matrix operations are performed on entire matrices. Additionally, the properties of matrix operations differ from regular arithmetic properties.

Can any matrices be multiplied together?

No, not all matrices can be multiplied together. For matrix multiplication, the number of columns in the first matrix must equal the number of rows in the second matrix. This is known as the "order" of the matrices, and it must be satisfied for multiplication to be possible.

What are some practical applications of matrix operations?

Matrix operations are used in a variety of fields, including computer graphics, physics, economics, and engineering. They can be used to solve systems of equations, represent transformations in space, and analyze data in a structured way. They are also an important tool in linear algebra, which has applications in many areas of mathematics and science.

Back
Top