Multiplication with mathematica

In summary, multiplication in Mathematica is the process of calculating the product of numbers or expressions using the * symbol. To multiply numbers, simply use the * symbol between them. Matrices can be multiplied using the . symbol, while element-wise multiplication can be done with the * symbol. Polynomials can also be multiplied using the * symbol.
  • #1
jtassilo
14
0
Hi,
I want to multiply two lists of the format {a1,b1,c1...}*{a2,b2,c2...} to obtain the list {a1*a2,b1*b2,c1*c2,...}. I tried using . to multiply the two lists but that didn't work.
What command do I have to use to obtain the desired result?
Thanks
 
Physics news on Phys.org
  • #2
a.b will give the scalar dot product of a and b. You want a b (space between a and b) or a*b either of which will give you the array multiplication of a and b.
 
  • #3
for your question! To multiply two lists in Mathematica, you can use the "Dot" function, which is represented by a period (.) between the two lists. However, in order for this to work, the lists must be of the same length and have the same dimensions. If this is not the case, you can use the "Times" function, which is represented by an asterisk (*) between the two lists. This will perform element-wise multiplication and give you the desired result. Hope this helps!
 

Related to Multiplication with mathematica

What is multiplication in Mathematica?

Multiplication in Mathematica is the process of calculating the product of two or more numbers or expressions. It is represented by an asterisk (*) symbol.

How do I multiply numbers in Mathematica?

To multiply numbers in Mathematica, you can simply use the asterisk symbol between the numbers or expressions. For example, to multiply 2 and 3, you can type 2*3 and press enter. The result will be 6.

Can I multiply matrices in Mathematica?

Yes, you can multiply matrices in Mathematica using the dot (.) symbol. For example, to multiply a 2x2 matrix A with a 2x3 matrix B, you can type A.B and press enter. The result will be a 2x3 matrix.

Is there a way to perform element-wise multiplication in Mathematica?

Yes, you can perform element-wise multiplication in Mathematica using the * symbol. For example, if you have two lists A={1,2,3} and B={4,5,6}, you can use the expression A*B to get the result {4,10,18}.

Can I multiply polynomials in Mathematica?

Yes, you can multiply polynomials in Mathematica using the * symbol. For example, to multiply the polynomials x^2+2x+3 and 2x+1, you can type (x^2+2x+3)*(2x+1) and press enter. The result will be a polynomial expression 2x^3+5x^2+7x+3.

Similar threads

Replies
7
Views
675
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
2K
  • Thermodynamics
Replies
1
Views
3K
  • General Math
Replies
5
Views
1K
  • Quantum Physics
Replies
32
Views
2K
  • Quantum Interpretations and Foundations
2
Replies
38
Views
4K
  • Precalculus Mathematics Homework Help
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
Back
Top