Hi how can i use function link() i wrote a code for my robotic program and that had a error that say "undefined input argument of "double" for function link"

DR=pi/180; L1=4; L2=3; L3=2;
alp(1)=0; a(1)=0; th(1)=0; d(1)=0;
alp(2)=0; a(2)=L1; th(2)=0; d(2)=0;
alp(3)=0; a(3)=L2; th(3)=0; d(3)=0;
L{1}=link([alp(1),a(1),th(1),d(1),0]),'mod');
L{2}=link([alp(2),a(2),th(2),d(2),0]),'mod');
L{3}=link([alp(3),a(3),th(3),d(3),0]),'mod');
ThreeR=robot(L,'plan3R');
q1=[0 0 0]*DR;
q2=[10 20 30]*DR;
q3=[90 90 90]*DR;
T30_1=fkine(ThreeR,q1);
T30_2=fkine(ThreeR,q2);
T30_3=fkine(ThreeR,q3);
TH3=[1 0 0 L3;0 1 0 0;0 0 1 0;0 0 0 1];
TH0_1=T30_1*TH3;
TH0_2=T30_2*TH3;
TH0_3=T30_3*TH3;

Answers (1)

I couldn't tell you why it's giving you that specific error (usually the phrasing of the error message is different), and it would probably help to see at least the function definition for link. However, in your code, every time you call link, you have an extra parenthesis:
L{1}=link(...),'mod');
It looks like you meant to do something like:
L{1}=link([alp(1),a(1),th(1),d(1),0],'mod');
if you want to pass 'mod' in as the second argument to link.
Also make sure that link is a function on the MATLAB search path, that the function name matches the file name, and that it accepts in the same number of input arguments that you are providing to it.
-Cam

Categories

Find more on Interpolation in Help Center and File Exchange

Tags

No tags entered yet.

Asked:

on 29 Jan 2018

Answered:

on 30 Jan 2018

Community Treasure Hunt

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

Start Hunting!