Find intersection between two curves (2024)

97 visualizzazioni (ultimi 30 giorni)

Mostra commenti meno recenti

Akash Gooljar il 7 Mar 2021

  • Link

    Link diretto a questa domanda

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves

  • Link

    Link diretto a questa domanda

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves

Commentato: Torsten il 6 Lug 2023

Risposta accettata: Jan

Apri in MATLAB Online

Hello i have plot two curves and i would like to create a function so as to find the intersections between the two curves

Here is my code :

x=-100*pi:pi/32:100*pi;

y1=exp(x);

y2=sin(x);

figure(1)

plot(y1,'b');hold on

plot(y2,'g');

hold off

grid

0 Commenti

Mostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Accedi per rispondere a questa domanda.

Risposta accettata

Jan il 7 Mar 2021

  • Link

    Link diretto a questa risposta

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#answer_641176

  • Link

    Link diretto a questa risposta

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#answer_641176

Modificato: Jan il 7 Mar 2021

The intersection is the location, where both functions have the same value. Then their difference is 0.

You can use fzero with the function: @(x) exp(x) - sin(x).

8 Commenti

Mostra 6 commenti meno recentiNascondi 6 commenti meno recenti

Akash Gooljar il 7 Mar 2021

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374296

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374296

Hello sir , thank you for the detailed explanations i did try but did not got the intersections

Jan il 7 Mar 2021

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374321

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374321

Modificato: Jan il 7 Mar 2021

Apri in MATLAB Online

Please post the code you have tried and explain, what "did not get" mean.

What is a meaningul range for searching for intersections? exp(x) is growing very fast, while sin(x) lives inside [-1, +1]. So maybe:

x = linspace(-4*pi, pi, 1000);

y1 = exp(x);

y2 = sin(x);

figure

plot(x, y1, 'b', x, y2, 'g');

Find intersection between two curves (5)

Then you could start the search for the zeros of @(x) exp(x) - sin(x) at e.g. -3 - these are the two inputs for fzero().

Akash Gooljar il 7 Mar 2021

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374541

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374541

x = linspace(-4*pi, pi, 1000);

y1 = exp(x);

y2 = sin(x);

figure

plot(x, y1, 'b', x, y2, 'g');

x1=y1 -y2;

fzero = (x1,-3);

Akash Gooljar il 7 Mar 2021

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374551

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1374551

i did try it like this,but im getting some errors

Jan il 8 Mar 2021

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1376041

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_1376041

Modificato: Jan il 8 Mar 2021

Apri in MATLAB Online

Please post the error message, if you mention an error.

fzero is a function. You have to provide a function as 1st input:

fzero(@(x) exp(x) - sin(x), -3)

Jan il 16 Ott 2022

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_2415863

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_2415863

Modificato: Jan il 16 Ott 2022

@Star Strider: What a pitty that you have deleted your answer. It was a valuable addition to my answer: You have considered the situation, that the input data are provided as vectors, while I suggested a method, when they are functions.

If somebody searchs in the forum for "intersection between two curves", your answer might have been more suiting then my one.

Your answers are too valuable to be deleted. They are useful and do not impede the readers.

I thought of unselecting my answer and accepting yours to keep it in the forum. But this cannot be a general strategy.

ANA MARIA SANCHEZ GONZALEZ il 6 Lug 2023

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_2807418

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_2807418

Hi guys! I need to find the intersection between two curves but one of them is given as vectors (experimental data). Could you please help me with that? Thank you in advance!

Torsten il 6 Lug 2023

Link diretto a questo commento

https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_2807468

  • Link

    Link diretto a questo commento

    https://it.mathworks.com/matlabcentral/answers/765326-find-intersection-between-two-curves#comment_2807468

Apri in MATLAB Online

Is interpolating the measurement data by a spline curve, taking the difference of the two so created curves and searching for a zero of this difference function an option ?

% Artificial measurement data

x = 0:0.1:2;

fi_measurement = x.^2;

% Second curve

f = @(x) x;

% Fit measurement data by spline curve

f_measurement = @(xq) interp1(x,fi_measurement,xq,'spline');

% Find intersection(s) between spline curve and second curve

sol1 = fzero(@(x)f(x)-f_measurement(x),0.5)

sol1 = -1.0469e-22

sol2 = fzero(@(x)f(x)-f_measurement(x),1.5)

sol2 = 1

Accedi per commentare.

Più risposte (0)

Accedi per rispondere a questa domanda.

Vedere anche

Categorie

AI, Data Science, and StatisticsCurve Fitting ToolboxSplinesSpline Postprocessing

Scopri di più su Spline Postprocessing in Help Center e File Exchange

Tag

  • curves
  • intersection

Prodotti

  • MATLAB

Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Si è verificato un errore

Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.


Translated by Find intersection between two curves (12)

Find intersection between two curves (13)

Seleziona un sito web

Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .

Puoi anche selezionare un sito web dal seguente elenco:

Americhe

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europa

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia-Pacifico

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contatta l’ufficio locale

Find intersection between two curves (2024)

References

Top Articles
Obituaries 1.10.2024 - Barton Chronicle Newspaper
Obituaries 2.7.2024 - Barton Chronicle Newspaper
What Is Single Sign-on (SSO)? Meaning and How It Works? | Fortinet
jazmen00 x & jazmen00 mega| Discover
Lorton Transfer Station
Cars & Trucks - By Owner near Kissimmee, FL - craigslist
Jazmen Jafar Linkedin
Chase Bank Operating Hours
Boggle Brain Busters Bonus Answers
craigslist: south coast jobs, apartments, for sale, services, community, and events
Notary Ups Hours
30% OFF Jellycat Promo Code - September 2024 (*NEW*)
Routing Number 041203824
Gw2 Legendary Amulet
Becky Hudson Free
Full Range 10 Bar Selection Box
10 Great Things You Might Know Troy McClure From | Topless Robot
Buying risk?
Lonadine
Ts Lillydoll
Mineral Wells Independent School District
Mychart Anmed Health Login
Epguides Strange New Worlds
Walgreens Alma School And Dynamite
Apple Original Films and Skydance Animation’s highly anticipated “Luck” to premiere globally on Apple TV+ on Friday, August 5
Reptile Expo Fayetteville Nc
Mc Donald's Bruck - Fast-Food-Restaurant
Atdhe Net
Rimworld Prison Break
Apparent assassination attempt | Suspect never had Trump in sight, did not get off shot: Officials
Weathervane Broken Monorail
United E Gift Card
Ripsi Terzian Instagram
Kattis-Solutions
Gideon Nicole Riddley Read Online Free
Save on Games, Flamingo, Toys Games & Novelties
A Man Called Otto Showtimes Near Carolina Mall Cinema
Drabcoplex Fishing Lure
Spinning Gold Showtimes Near Emagine Birch Run
Hermann Memorial Urgent Care Near Me
Clark County Ky Busted Newspaper
Atlanta Musicians Craigslist
Indiana Jones 5 Showtimes Near Cinemark Stroud Mall And Xd
11301 Lakeline Blvd Parkline Plaza Ctr Ste 150
Thelemagick Library - The New Comment to Liber AL vel Legis
Easy Pigs in a Blanket Recipe - Emmandi's Kitchen
Craigslist Pet Phoenix
La Qua Brothers Funeral Home
Tropical Smoothie Address
R Detroit Lions
Round Yellow Adderall
Latest Posts
Article information

Author: Otha Schamberger

Last Updated:

Views: 5731

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Otha Schamberger

Birthday: 1999-08-15

Address: Suite 490 606 Hammes Ferry, Carterhaven, IL 62290

Phone: +8557035444877

Job: Forward IT Agent

Hobby: Fishing, Flying, Jewelry making, Digital arts, Sand art, Parkour, tabletop games

Introduction: My name is Otha Schamberger, I am a vast, good, healthy, cheerful, energetic, gorgeous, magnificent person who loves writing and wants to share my knowledge and understanding with you.