Undefined function or variable 'Link'. Error in Robotics>btn_Forward_Callback (line 158) L(1) = Link([0 L_1 0 pi/2]); Error in gui_mainfcn (line 95) feval(varargin{:}); Error in Robotics (line 42) gui_mainfcn(gui_State, varargin{:});
Show older comments
% --- Executes on button press in btn_Forward.
function btn_Forward_Callback(hObject, eventdata, handles)
% hObject handle to btn_Forward (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Th_1 = str2double(handles.Theta_1.String)*pi/180;
Th_2 = str2double(handles.Theta_2.String)*pi/180;
Th_3 = str2double(handles.Theta_3.String)*pi/180;
L_1 = 20;
L_2 = 50;
L_3 = 40;
L(1) = Link([0 L_1 0 pi/2]);
L(2) = Link([0 0 L_2 0]);
L(3) = Link([0 0 L_3 0]);
Robot = SerialLink(L);
Robot.name = 'Robot';
Robot.plot([Th_1 Th_2 Th_3]);
T = Robot.fkine([Th_1 Th_2 Th_3]);
handles.Pos_X.String = num2str(floor(T(1,4)));
handles.Pos_Y.String = num2str(floor(T(2,4)));
handles.Pos_Z.String = num2str(floor(T(3,4)));
1 Comment
Geoff Hayes
on 11 Feb 2018
Ken - what is Link? I'm guessing it is a function of some kind where you input an array of four elements, but it is unclear what the output will be. (Or how even L is used after that.) Is Link a custom function that can be found within the MATLAB search path?
Answers (2)
dulith chinthaka
on 8 Mar 2018
Edited: dulith chinthaka
on 8 Mar 2018
1 vote
you need to download robotic Toolbox library that is the reason for this error.
Nabil12347
on 1 Apr 2019
0 votes
hello please help me i downloaded toolbox on the site petercorke i run it normal but the problem the function Link () does not run with MATLAB that i have 2017 however that toolbox i have download is 2015 answer me as soon as possible
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!