Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab - basic script

  1. Nov 6, 2013 #1
    Attahced is my short matlab script, im basically trying to use iteration to plot 2 sets of 2 functions to see where they intersect, all other information in the script are constants. attached also is the incorrect graph that i get

    flux = F

    If = Ifield

    Any help would be appreciated

    Attached Files:

  2. jcsd
  3. Nov 21, 2013 #2


    User Avatar
    Gold Member

    You plotted a few points instead of each function.

    The way you've defined everything, there are no variables. Everything is a constant, which is why you only get points. Should you be varying w to plot each function?

    Also, if you just want to know where the two functions of the form m = tanh(m) intersect, you can also plot m-tanh(m) and use fzero() to find the zero where they are equal.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook