Re: Intersect problem



Derek <derek_ooi2003@xxxxxxxxxxx> wrote in
news:ef57b1a.-1@xxxxxxxxxxxxxxxxxxxxxxx:

I wanted to find the intersect of 2 graphs

My first graph is generated from the points inside a text
file. I had no problem generating the graph.
______________________________________________________
data = load('table1.txt'); %load data from equipment

current = data(:, 1); %current
voltage = data(:, 2); %voltage
a=plot(voltage,current)
hold on
_______________________________________________________

My second graph is generated from an equation 'y=mx'. No
problem generating the graph also.
_______________________________________________________
V=0:1:12;
I=V/0.1;
b=plot(V,I)
________________________________________________________

However problem arise when i want to intersect both graphs.
I insert intersect(a,b) to find the intersection, but no
values are produced. I check the 2 graphs and the 2 graphs 2
intersect at 1 point. Can any1 point out where my problems
are Thx.


I think the problem is that intersect is not doing what you think
it does, the function name is misleading in my opinion. It does
not calculate the intersection between 2 lines but "returns the
values common to both A and B". So your voltage would have to be
exactly 6.0 and current exactly 60.0 to get an intersection
point.

Look on Matlab central for curveintersect, This may well do what
you require. I've not used it as I've written my own little
utility to a calculate line intersection.

Hope this helps

Adrian

.



Relevant Pages

  • Re: Need help graphing an equation
    ... Think how you'd go about doing it with a calculator, a pen and a sheet of grid paper. ... That means they won't have intersection points, ... If you had only two different suppliers to compare, I'd suggest graphing four lines of z against x for four values of y, for each of two suppliers, and joining the four points of intersection to show the line. ... But the intersection line will have variable y, making it hard to interpret on a graph of z against x. ...
    (microsoft.public.excel.charting)
  • Re: Damn you, FEDEX! or Nikon D40 lost in Springfield, MO blackhole.
    ... the 2 mp Mavica he had been using with a Nikon D40. ... After shopping around, he got me to order one for him. ... The shipper had it insured, but from what I have read it could take weeks to sort this crap out. ... You may get your insurance from FedEx and a couple weeks later they find it and deliver it. ...
    (alt.photography)
  • Re: White House spins "The Commander Guy"
    ... Now tell me how you can be so cast iron certain that and SAT of 1200 ... I'd say the intersection of an SAT score of 1200 on graph a intersects ... Thanks for the supporting data. ... Then you cannot read a graph - it is closer to the low to mid 120's. ...
    (rec.sport.golf)
  • Re: Geometrical meaning of imaginary roots?
    ... These two graphs have no intersection points in the real coordinate ... We think of the graph of a real function of real variable as a ... R, the plane. ...
    (sci.math)
  • Re: What is the real voltage from an AC/DC adaptor ?
    ... The graph will trace out current and voltage ... > to find the exact voltage the adaptor produces because of this. ...
    (sci.electronics.basics)

Loading