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!

Homework Help: MATLAB Error Message while trying to Plot Magnification Factor

  1. Apr 11, 2013 #1
    1. The problem statement, all variables and given/known data

    I am trying to make a plot of the magnification factor of an underdamped vibrating system versus the frequency ratio using MATLAB. However, my MATLAB skills are very basic and I keep getting an error message.

    Basically I am trying to plot:

    MF=1/√((1-r^2)^2+(2ζr)^2) where ζ=0.01

    I will be making the plot for other values of ζ later.

    2. Relevant equations

    MF=1/√((1-r^2)^2+(2ζr)^2) where ζ=0.01

    3. The attempt at a solution

    http://img198.imageshack.us/img198/7758/matlabw.png [Broken]

    *The x-axis will range from 0 to 3.0

    After this, I will use the code semilogy(r,MF); to generate the plot.

    Last edited by a moderator: May 6, 2017
  2. jcsd
  3. Apr 11, 2013 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Well, element-wise exponentiation is what you want. Did you try using .^ for ALL of the instances of ^ in your equation?
  4. Apr 11, 2013 #3
    I actually just figured that out. I kept leaving out the ".^" in front of the final power of 0.5. Thanks for the help!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted