How can i generate a function using this points?
조회 수: 7 (최근 30일)
이전 댓글 표시
If i got x=[1,3,8,25,45,23]; and y=[25,24,13,69,25,75];
댓글 수: 4
Adam
2018년 8월 29일
There are an infinite number of functions that could take that one example input and give that output.
채택된 답변
추가 답변 (1개)
Cesar Antonio Lopez Segura
2018년 8월 29일
Hi Here the solution:
% Your cloud point
x=[1,3,8,25,45,23];
y=[25,24,13,69,25,75];
% calculate a new cloud point that contain the last one
xnew = [1, 1.5 ,3,6,8,25,32,45,31,23];
ynew = interp1( x,y, xnew,'pchip' );
% plot de new values
plot(x,y,'o');hold on;plot( xnew, ynew,'r' )
% polinomios
p = interp1( x,y,'pchip' );
댓글 수: 5
Cesar Antonio Lopez Segura
2018년 8월 30일
You can define x values in ascending order with sort.
Then you can order de y values.
[xtointerpol indx ] = sort(x);
ytointerpol = y(indx);
참고 항목
카테고리
Help Center 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!