(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

Hello,

I'm having a problem in multiplying two vectors together in a specific way in Fortran. I can do it in Matlab, but can't work out how to do it in Fortran.

The problem is that i want to multiply two vectors together, but only each element by it's corresponding element in the other vector. In Matlab you simply use A.*B which works perfectly.

2. Relevant equations

For example if A = [1 2 3]'

and B = [4 5 6]'

Then A.*B = [4 10 18]

3. The attempt at a solution

Any attempt i make in Fortran tries to multiply all the elements together (usually by dot product etc), but i just want the first element multiplied by the first element, and then the second mulitplied by the second etc.

Sorry about the strange formatting, i tried to crowbar this question into the template...

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Fortran element by element array multiplication

**Physics Forums | Science Articles, Homework Help, Discussion**