-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenDHTable.m
More file actions
26 lines (20 loc) · 713 Bytes
/
genDHTable.m
File metadata and controls
26 lines (20 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function [symDH] = genDHTable(a, d, alpha, theta)
%UNTITLED9 Summary of this function goes here
% Detailed explanation goes here
%Assign the variables to symbolic parameters
symThetas = sym('Theta',[1, length(theta)]);
symThetas = transpose(symThetas);
symD = sym('D',[1,length(d)]);
symD = transpose(symD);
%Create a symbollic DH matrix
symA = sym('a',[1 length(a)]);
symA = transpose(symA);
symAlpha = sym('alpha', [1 length(alpha)]);
symAlpha = transpose(symAlpha);
symDH = [symA symD symAlpha symThetas];
for i = 1:length(a)
symDH = subs(symDH,symDH(i,1),a(i));
symDH = subs(symDH,symDH(i,2),d(i));
symDH = subs(symDH,symDH(i,3),alpha(i));
symDH = subs(symDH,symDH(i,4),theta(i));
end