To find the points of intersection of two functions in Matlab, you can follow these steps:
main.m51 chars3 lines
Note: make sure the two functions have the same domain.
main.m75 chars6 lines
fzero
function to find the intersection points numerically:main.m79 chars4 lines
Note: the fzero
function finds a zero of a given function, which in this case corresponds to an intersection point of f
and g
.
main.m151 chars4 lines
Here's the complete code:
main.m476 chars21 lines
gistlibby LogSnag