# Homework Help: Matlab - vector division?

1. Oct 10, 2011

### Inertigratus

1. The problem statement, all variables and given/known data
Just tried something out and was wondering.
If I have a vector X and do the division 1./X then that will result in a vector in which each element is the reciprocal of the corresponding element in X right?
But what does 1/X do?
I'm wondering because I noticed that the result is different and 1/X gave me the result I was looking for.
Last question, is dot(Y,1/X) valid for dividing Y by X? If Y and X are both vectors of the same length.

2. Relevant equations
1/X
1./X
dot(Y,1/X)

3. The attempt at a solution
I got the result I was looking for and trying to understand why this worked.
At first I did element-wise division, Y./X and it gave me something else which was wrong.
Additionally, if someones good with Matlab. How can I compare two even-length matrices/vectors and get back how many elements are equal in %?
Like how many % vector A is equal to vector B.

Last edited: Oct 10, 2011