MATLAB Script Help - Plotting 2 Functions to Find Intersection

  • Context: MATLAB 
  • Thread starter Thread starter MMCS
  • Start date Start date
  • Tags Tags
    Matlab
MMCS
Messages
151
Reaction score
0
Attahced is my short MATLAB script, I am 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
 

Attachments

  • matlab.jpg
    matlab.jpg
    19.1 KB · Views: 546
on Phys.org
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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
5K