hi matlab community please help for this question.
Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
how to find intersection point of these graph??
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
.png)
filename = 'gg.csv';
A = xlsread(filename);
filename = 'gg.csv';
sheet = 1;
x1=A(:,1);
y1=A(:,2);
hold on
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
set(gcf, 'Name', 'champion manufactering', 'NumberTitle', 'Off')
x2=[0 200 400 700];
y2=[55 65 70 40];
plot(x1,y1);
plot(x2,y2);
hold off
1 Commento
Risposta accettata
KSSV
il 19 Mar 2019
Use this file exchange function:
11 Commenti
Rahul punk
il 19 Mar 2019
i already try this method
Rahul punk
il 19 Mar 2019
but not work
Rahul punk
il 19 Mar 2019
p=interX([x1:y1],[x2;y2]);
plot(x1,y1 ,x2 ,y2, p(1,:),p(2,:),'ro');
not work
Rahul punk
il 19 Mar 2019
this is excell data file please write the code kssv
Rahul punk
il 19 Mar 2019
second one is this write in above code
x2=[0 200 400 700];
y2=[55 65 70 40];
plot(x1,y1);
KSSV
il 19 Mar 2019
[num,txt,raw] = xlsread('gg.csv') ;
x1 = num(:,1) ; y1 = num(:,2) ;
x2=[0 200 400 700];
y2=[55 65 70 40];
L1 = [x1 y1]' ;
L2 = [x2 ; y2] ;
P = InterX(L1,L2) ;
plot(x1,y1,'r')
hold on
plot(x2,y2,'b')
plot(P(1,:),P(2,:),'*g')

Rahul punk
il 19 Mar 2019
kssv!, sir very thanful for give for valuable time to write code ,no words for your wonderfull help thank so much!
Rahul punk
il 19 Mar 2019
sir one more how to count these intersection point
and code show me error! some time .
Più risposte (1)
KSSV
il 19 Mar 2019
Read about size.
10 Commenti
Rahul punk
il 19 Mar 2019
p show some value but i have multiply by 20 and then disp values
Rahul punk
il 19 Mar 2019
m=p*20;
disp(m)
ARUN
il 4 Mag 2021
Modificato: ARUN
il 4 Mag 2021
Hello, I am also trying to get similar kind of intersection points, I used the function InterX but I am not getting all the intersection point.
Below is my plot. I need to find the intersection point of red curve on each horizontal green line. Can you please tell me whether this algorithm(InterX) works for this scenario

Rahul punk
il 5 Mag 2021
ARUN
il 5 Mag 2021
Modificato: KSSV
il 6 Mag 2021
I tried with this, but I am not getting proper intersection points:
Below is the code(attached datapoints)
P1 = [Xin,Yin];
P2 = [Xout,Yout];
Xa = [P1(:,1),P2(:,1)];
Xb = [P1(:,2),P2(:,2)];
Xa1 = Xa';
Xb1 = Xb';
X1 = X';
Y1 = Y';
plot(Xa1,Xb1,'g');
hold on
plot(X1,Y1)
L1 = [X1;Y1];
L2 = [Xa1; Xb1];
P = InterX(L1,L2);
KSSV
il 5 Mag 2021
You need to proceed like this:
load('VItrack1.mat')
P1 = [Xin,Yin];
P2 = [Xout,Yout];
Xa = [P1(:,1),P2(:,1)];
Xb = [P1(:,2),P2(:,2)];
Xa1 = Xa';
Xb1 = Xb';
X1 = X';
Y1 = Y';
L1 = [X1;Y1];
L2 = [Xa1; Xb1];
n = size(Xa1,2) ;
P = NaN(2,n) ;
for i = 1:n
L2 = [Xa1(:,i)' ; Xb1(:,i)'] ;
p = InterX(L1,L2);
if ~isempty(p)
P(:,i) = InterX(L1,L2);
end
end
plot(Xa1,Xb1,'g');
hold on
plot(X1,Y1,'b')
plot(P(1,:),P(2,:),'.r')
ARUN
il 5 Mag 2021
Thank you so much for your help! But when I tried the same alogorithm for different datapoints I am getting an error as below:
Unable to perform assignment because the size of the left side is 2-by-1 and the size of the right side is 2-by-3.
Error in Myexample2 (line 69)
P(:,i) = InterX(L1,L2);
Attaching datapoints for your reference.
Could you help me to solve this. Thank you.
Vedere anche
Categorie
Scopri di più su Tables in Help Center e File Exchange
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.
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:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
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
- United Kingdom (English)
Asia-Pacifico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)