1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab - vector division?

  1. Oct 10, 2011 #1
    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
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?



Similar Discussions: Matlab - vector division?
  1. Matlab help (Replies: 0)

  2. Help with Matlab (Replies: 0)

  3. Matlab Problem (Replies: 0)

  4. MATLAB: Optimization (Replies: 0)

Loading...