| Author |
Message |
m_eh_62
Joined: 05 Mar 2007 Posts: 51 Helped: 5
|
22 Sep 2007 21:14 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.
|
|
| Back to top |
|
 |
echo47
Joined: 07 Apr 2002 Posts: 4206 Helped: 566
|
23 Sep 2007 3:43 matlab find intersection |
|
|
|
|
I'm not sure what output format you need, but maybe you can use my small example:
http://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.
|
|
| Back to top |
|
 |
Element_115
Joined: 23 Mar 2002 Posts: 359 Helped: 23
|
24 Sep 2007 16:59 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
|
|
| Back to top |
|
 |
Google AdSense

|
24 Sep 2007 16:59 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
m_eh_62
Joined: 05 Mar 2007 Posts: 51 Helped: 5
|
24 Sep 2007 19:03 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.
|
|
| Back to top |
|
 |
dogan19213
Joined: 05 Nov 2009 Posts: 1
|
05 Nov 2009 1:55 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.
|
|
| Back to top |
|
 |