+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Member level 2
    Points: 1,459, Level: 8

    Join Date
    Mar 2007
    Posts
    49
    Helped
    5 / 5
    Points
    1,459
    Level
    8

    matlab intersection

    Dear friend
    I want to find the intersection of this plot:
    the blue one is a .mat file and the other on is:

    Th=.1453*ones(527,1);
    plot(Th)

    Ineed the source to find these intersection points:



    thanks.

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 32,456, Level: 44

    Join Date
    Apr 2002
    Location
    USA
    Posts
    3,942
    Helped
    663 / 663
    Points
    32,456
    Level
    44

    matlab find intersection

    I'm not sure what output format you need, but maybe you can use my small example:
    https://www.edaboard.com/ftopic269296.html#899375

    It outputs a list of array indexes identifying the zero-crossing points.
    You can easily change it from zero-crossing to 0.1453-crossing.



    •   AltAdvertisement

        
       

  3. #3
    Advanced Member level 2
    Points: 5,822, Level: 18

    Join Date
    Mar 2002
    Posts
    509
    Helped
    72 / 72
    Points
    5,822
    Level
    18

    line intersection matlab

    It looks simple.

    a= 0.18 % The value of the red line.

    ii=1 % Counter
    for i=1:550

    b(i) = Blue line(i)
    if b(i)==a
    c(ii) = i;
    ii=ii+1;
    end if
    end

    c % c is an array of of the "X" values where the red & Blue lines are equal.
    % This assumes that the red and blue lines have data points at the
    % intersection.

    This is the general idea, you will have to make sure the x-axis resolution is high
    enough to assure red is = blue at those points.
    ie. if blue(330) =.178 & blue(331)= .181 then this will not work (Assuming
    red=.180)

    Hope this helps



    •   AltAdvertisement

        
       

  4. #4
    Member level 2
    Points: 1,459, Level: 8

    Join Date
    Mar 2007
    Posts
    49
    Helped
    5 / 5
    Points
    1,459
    Level
    8

    matlab line intersection

    yea I find the intersection points.
    in fact I want to find the intersection points.
    after that I should test that if the distance between two points is less than 0.25 or not?
    if this condition was true I should save the first point and eliminte the other one and if this condition was wrong I should save each of them.
    then I should Reconstruct the blue one signal.
    what could be the reconsruction Algorithm?
    more accurate I after finding the intersection points I want to reconstruct the blue one plot without smaller segment.
    Can you help me?
    thanks.



  5. #5
    Newbie level 1
    Points: 553, Level: 5

    Join Date
    Nov 2009
    Posts
    1
    Helped
    0 / 0
    Points
    553
    Level
    5

    Re: How can find intersection of this plots in Matlab

    i need your help, too. (H1=0.25, B=0.58, z1 and z2 are changing between 0.1 and 1)

    H1=input('H1 degerini giriniz:');
    B=input('B degerini giriniz:');
    z=-((1-B)/H1):0.1:B/H1;
    FA=-H1*z.^2+z.*B;
    FO=z.*[(1-B)+z.*H1];
    plot(FA,FO);
    hold on
    z1=input('kritik frenleme oranini giriniz:');
    line([0 z1],[z1 0]);
    z2=input('yol sartini giriniz:');
    line([0 z2],[z2 0]);

    this is from an m-file. i want to plot one more line that starts at [0 0] and ends at the intersection point of curve and line(z2). but i want this line to change when the other values change. because the intersection point changes for all the different values of z2. I hope you can do that. thank you.



--[[ ]]--