필터 지우기
필터 지우기

How to use matlab 'spline' function in simulink ?

조회 수: 3 (최근 30일)
Sandeep Hanwate
Sandeep Hanwate 2016년 4월 7일
댓글: Titus Edelhofer 2016년 4월 11일
Hi, I was trying to generate robot trajectory using spline function in simulink, I tried with all user function block available in simulink library but it is getting error the image is shown below. Can anybody help for this issue.

채택된 답변

Titus Edelhofer
Titus Edelhofer 2016년 4월 7일
Hi,
the error message tells you what to do, namely "declare" spline as being used not by code generation but by MATLAB:
doc coder.extrinsic
Titus
  댓글 수: 2
Sandeep Hanwate
Sandeep Hanwate 2016년 4월 8일
Thanks for answer Titus Edelhofer, but still facing the error to execute this small function in simulink, the function i am using is:
function y=fcn(t)
u1= [0 1]; %$DH
u2= [0 2]; %init
coder.extrinsic('spline')
ay = zeros();
y = spline(u1,u2,t);
Titus Edelhofer
Titus Edelhofer 2016년 4월 11일
Hi,
except from the typo ("ay = zeros") and the not very interesting u1 and u2 it's fine. I tried this and get nice sine approximation (as in doc spline):
function y = fcn(t)
u1= 0:10; %$DH
u2= sin(u1); %init
coder.extrinsic('spline')
y = 0;
y = spline(u1,u2,t);
Titus

댓글을 달려면 로그인하십시오.

추가 답변 (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