필터 지우기
필터 지우기

Could you help me Find intersection between spline and polyfit

조회 수: 4 (최근 30일)
Peter
Peter 2012년 3월 18일
Hello everybody, please can somebody help me? I have spline and polynomial curve of degree one. These two curves intersect (I mean spline and polyfit). CAN YOU HELP ME HOW TO FIND POINT OF INTERSECTION (Coordinates)???? Example of my spline and polyfit.
xx1 = start:0.1:end;
yy1 = spline (points(:,1),points(:,2),xx1);
% plot(points(:,1),points(:,2),'bo',xx1,yy1,'b', 'LineWidth', 2);
plot(xx1,yy1,'b', 'LineWidth', 2);
pol11 = polyfit(K1,K2,1);
s11 = start1:0.1:end1;
ss11 = polyval(pol11,s11);
plot(s11,ss11,'r','Linewidth',2)
This is only part of my code. Thanks everybody for any help!!!!!

채택된 답변

John D'Errico
John D'Errico 2012년 3월 18일
Use fzero. Or roots, if you have the chops. Note that a polynomial segment is just a cubic. Subtracting the two functions and setting the result to zero must give an intersection.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Splines에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by