Hello!
I'm trying to get the coordinates from a graph when Y cross the X axis (Y=0) and I'm having trouble finding this solution. The plot is basically a combination of points (X and Y) and do not necessarily have integer values. How can I proceed? Thanks
Here is an example of this plot:
X = [-205078000000000,00 -190430000000000,00 -175781000000000,00 -156250000000000,00 -141602000000000,00 -117188000000000,00 -102539000000000,00 -0.927730000000000 -0.781250000000000 -0.732420000000000 -0.537110000000000 -0.341800000000000 -0.195310000000000 0,00 0,00 0.195310000000000 0.292970000000000 0.439450000000000 0.683590000000000 0.732420000000000 0.878910000000000 0.976560000000000 112305000000000,00 136719000000000,00 151367000000000,00 170898000000000,00 190430000000000,00 205078000000000,00 224609000000000,00 229492000000000,00 253906000000000,00 268555000000000,00 283203000000000,00 302734000000000,00 317383000000000,00 332031000000000,00 332031000000000,00 341797000000000,00 351563000000000,00 351563000000000,00 361328000000000,00 375977000000000,00 395508000000000,00 410156000000000,00 415039000000000,00 434570000000000,00 449219000000000,00 454102000000000,00 463867000000000,00 463867000000000,00 473633000000000,00 473633000000000,00 478516000000000,00 493164000000000,00 493164000000000,00 517578000000000,00 527344000000000,00 541992000000000,00 556641000000000,00 556641000000000,00 571289000000000,00 585938000000000,00 610352000000000,00 625000000000000,00 649414000000000,00 668945000000000,00 673828000000000,00 683594000000000,00 693359000000000,00 703125000000000,00 717773000000000,00 722656000000000,00 732422000000000,00 742188000000000,00 742188000000000,00 756836000000000,00 761719000000000,00 766602000000000,00 776367000000000,00 771484000000000,00 786133000000000,00 786133000000000,00 800781000000000,00 815430000000000,00 820313000000000,00 834961000000000,00 839844000000000,00 864258000000000,00 878906000000000,00 888672000000000,00 898438000000000,00 903320000000000,00 908203000000000,00 917969000000000,00 922852000000000,00 932617000000000,00 957031000000000,00 986328000000000,00 102050800000000,00 104980500000000,00 106933600000000,00];
Y = [-599739554,78 -592692899,06 -585506566,66 -578279633,17 -570989523,41 -563491989,06 -556244088,36 -549103770,37 -542052956,48 -535074784,20 -527790864,49 -520300201,53 -512578856,84 -505085873,20 -497922253,87 -490469464,07 -482829624,94 -475103570,06 -467389867,06 -459544952,05 -451309009,84 -442905023,74 -434313642,96 -425753113,26 -417197361,63 -408380357,33 -399517893,17 -390464118,51 -381435719,92 -372531106,70 -363367781,94 -353921258,30 -343925703,27 -333718484,48 -323635657,72 -313532373,15 -303509237,80 -293189267,41 -282435147,05 -271229641,22 -259677782,79 -248242552,53 -236778917,55 -225139611,40 -213059945,34 -200518042,22 -187970390,89 -175271962,77 -162281991,85 -148741072,85 -134631399,94 -120296203,82 -105476980,93 -90153609,80 -74182708,22 -57539659,82 -40556371,36 -22961799,25 -4846997,45 13695312,86 32690081,45 52045480,45 72037101,38 92461238,40 113355702,71 134880430,21 156831072,44 179358633,58 202372519,02 226024807,22 250348801,76 275016871,16 300302132,57 326116714,50 352492722,64 379582271,39 407178786,87 435436666,75 464268793,30 493949086,28 524630692,18 556108378,52 588660907,86 622089281,37 656437508,95 691868860,42 728427166,74 766400618,17 805360016,95 845237609,53 886203228,12 928184532,61 971469553,39 1015865477,26 1061422731,82 1108313448,57 1156353913,06 1205731942,44 1256402226,25 1308563976,55 1362294061,31];

 Réponse acceptée

John D'Errico
John D'Errico le 19 Mar 2023
Modifié(e) : John D'Errico le 19 Mar 2023
X = [-205078000000000.00 -190430000000000.00 -175781000000000.00 -156250000000000.00 -141602000000000.00 -117188000000000.00 -102539000000000.00 -0.927730000000000 -0.781250000000000 -0.732420000000000 -0.537110000000000 -0.341800000000000 -0.195310000000000 0.00 0.00 0.195310000000000 0.292970000000000 0.439450000000000 0.683590000000000 0.732420000000000 0.878910000000000 0.976560000000000 112305000000000.00 136719000000000.00 151367000000000.00 170898000000000.00 190430000000000.00 205078000000000.00 224609000000000.00 229492000000000.00 253906000000000.00 268555000000000.00 283203000000000.00 302734000000000.00 317383000000000.00 332031000000000.00 332031000000000.00 341797000000000.00 351563000000000.00 351563000000000.00 361328000000000.00 375977000000000.00 395508000000000.00 410156000000000.00 415039000000000.00 434570000000000.00 449219000000000.00 454102000000000.00 463867000000000.00 463867000000000.00 473633000000000.00 473633000000000.00 478516000000000.00 493164000000000.00 493164000000000.00 517578000000000.00 527344000000000.00 541992000000000.00 556641000000000.00 556641000000000.00 571289000000000.00 585938000000000.00 610352000000000.00 625000000000000.00 649414000000000.00 668945000000000.00 673828000000000.00 683594000000000.00 693359000000000.00 703125000000000.00 717773000000000.00 722656000000000.00 732422000000000.00 742188000000000.00 742188000000000.00 756836000000000.00 761719000000000.00 766602000000000.00 776367000000000.00 771484000000000.00 786133000000000.00 786133000000000.00 800781000000000.00 815430000000000.00 820313000000000.00 834961000000000.00 839844000000000.00 864258000000000.00 878906000000000.00 888672000000000.00 898438000000000.00 903320000000000.00 908203000000000.00 917969000000000.00 922852000000000.00 932617000000000.00 957031000000000.00 986328000000000.00 102050800000000.00 104980500000000.00 106933600000000.00];
Y = [-599739554.78 -592692899.06 -585506566.66 -578279633.17 -570989523.41 -563491989.06 -556244088.36 -549103770.37 -542052956.48 -535074784.20 -527790864.49 -520300201.53 -512578856.84 -505085873.20 -497922253.87 -490469464.07 -482829624.94 -475103570.06 -467389867.06 -459544952.05 -451309009.84 -442905023.74 -434313642.96 -425753113.26 -417197361.63 -408380357.33 -399517893.17 -390464118.51 -381435719.92 -372531106.70 -363367781.94 -353921258.30 -343925703.27 -333718484.48 -323635657.72 -313532373.15 -303509237.80 -293189267.41 -282435147.05 -271229641.22 -259677782.79 -248242552.53 -236778917.55 -225139611.40 -213059945.34 -200518042.22 -187970390.89 -175271962.77 -162281991.85 -148741072.85 -134631399.94 -120296203.82 -105476980.93 -90153609.80 -74182708.22 -57539659.82 -40556371.36 -22961799.25 -4846997.45 13695312.86 32690081.45 52045480.45 72037101.38 92461238.40 113355702.71 134880430.21 156831072.44 179358633.58 202372519.02 226024807.22 250348801.76 275016871.16 300302132.57 326116714.50 352492722.64 379582271.39 407178786.87 435436666.75 464268793.30 493949086.28 524630692.18 556108378.52 588660907.86 622089281.37 656437508.95 691868860.42 728427166.74 766400618.17 805360016.95 845237609.53 886203228.12 928184532.61 971469553.39 1015865477.26 1061422731.82 1108313448.57 1156353913.06 1205731942.44 1256402226.25 1308563976.55 1362294061.31];
Using the code from Doug Schwarz's intersections code from the FEX, it is as easy as thiis:
format long g
xloc = intersections(X,Y,[min(X),max(X)],[0 0])
xloc =
556641000000000
Find intersections on the FEX, here:

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by