how to repeat this code for 3 tie intervals??
조회 수: 1 (최근 30일)
이전 댓글 표시
this code is to find the coefficinets of the third order polynomial in a motion planning: function x=pol3interpol(tk,tk1,qk,qk1,dotqk,dotqk1)
A=[1,tk,tk^2,tk^3; 1,tk1,tk1^2,tk1^3; 0,1,2*tk,3*tk^2; 0,1,2*tk1,3*tk1^2];
C=[qk,qk1,dotqk,dotqk1]';
x=inv(A)*C; where: % qk initial joint position % qk1 final joint position % dotqk initial joint speed % dotqk1 final joint speed % tk=initial time % tk1=final time
I can find the values of the coefficines a0, a1,a2,a3 by this code. but how can I repeat it for 3 times for the values above?
q0=[0 2 5];% Initial position qk1=[2 5 0];% Final position dotqk=[0 0 0];% Initial velocity dotqk1=[0 0 0];% Final velocity tk=[0 2 4]; % Initial time tk1=[2 4 6];% Final time
댓글 수: 0
채택된 답변
KALYAN ACHARJYA
2018년 9월 19일
편집: KALYAN ACHARJYA
2018년 9월 19일
A=[1,tk,tk^2,tk^3; 1,tk1,tk1^2,tk1^3; 0,1,2*tk,3*tk^2; 0,1,2*tk1,3*tk1^2];
C=[qk,qk1,dotqk,dotqk1]';
for i=1:3
x=inv(A)*C
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!