Last active
November 2, 2017 23:31
-
-
Save kor01/5bcf675cc7bd5e2f62f78f5b12e90ac0 to your computer and use it in GitHub Desktop.
[matlab robotics] #robotics #matlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hold on | |
plot(x(1, :), x(2,:)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% declaration | |
syms v u | |
w = 2*v + u | |
% differentiation | |
diff(w, v) | |
% define functions | |
syms a b c x | |
f(x) = a*x^2 + b*x + c | |
% evaluate function | |
syms r | |
fr = f(r) | |
f3 = f(3) | |
%evaluation sybolic expression | |
% substitude in expression of w, set v=5 | |
subs(w, v, 5) | |
% subsititude with another variable | |
subs(w, v, x) | |
% get numeric answer | |
w = v + 1/2 | |
subs(w, v, 4) | |
vpa(subs(w,v,4)) | |
% generate a symbolic matrix | |
A = sym('a', [3, 6]) | |
% define a symbolic rotation | |
syms theta, d | |
T = [cos(theta) -sin(theta) 0; sin(theta) cos(theta) 0; 0 0 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment