From: someone on
"faisal " <maabdolat(a)yahoo.com> wrote in message <hvgia4$8gn$1(a)fred.mathworks.com>...
> Thanks for helping me out, but it wil be a great favour if u write me the code, because i m new user of matlab and does not know how to do what u said....
>
> regards

You can start here:

http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/bqr_2pl.html
From: Bruno Luong on
One way, use this FEX file:

http://www.mathworks.com/matlabcentral/fileexchange/27673-2d-polygon-edges-intersection

>> P1=[0,2765; 0.2,2580; 0.4,2370; 0.6,2160; 0.8,1905; 0.9,1765; 1,1490].';

>> xmin=min(P1(1,:));
>> xmax=max(P1(1,:));
>> ymin=polyval([3073 -860],xmin);
>> ymax=polyval([3073 -860],xmax);
>> P2=[xmin xmax; ymin ymax];

>> xycross = poly2poly(P1,P2)

xycross =

1.0e+003 *

0.0009 0.0008 0.0009 0.0008
1.8090 1.7020 1.8090 1.7020

Bruno
From: faisal on
Thanks for helping me,,

but i found a link that is the exact answer of my question,

http://www.mathworks.fr/matlabcentral/fileexchange/11837-fast-and-robust-curve-intersections

This link is great achievement by the writer,
thanks 4 ur kind help & guidence

regards
From: Gang-Gyoo on
Hi Guy,

Here is a piece of code that you need.

Gang-Gyoo Jin

------------------------------
function main
xx= [0 0.2 0.4 0.6 0.8 0.9 1];
yy= [2765 2580 2370 2160 1905 1765 1490];
plot(xx,yy,'o'), hold on

n= 6;
p= polyfit(xx,yy,n);
x= 0:0.02:1;
y1= polyval(p,x);
plot(x,y1)

y2= 3073*x-860;
plot(x,y2)
hold off

x0= 0;
x= fsolve(@myfun,x0)

function f= myfun(x)
y1= 3073*x-860;
xx= [0 0.2 0.4 0.6 0.8 0.9 1];
yy= [2765 2580 2370 2160 1905 1765 1490];
n= 6; % data no-1
p= polyfit(xx,yy,n);
y2= polyval(p,x);
f= y1-y2;
First  |  Prev  | 
Pages: 1 2
Prev: Legend in scatter plot
Next: update GUI while in .m