add lkneeExample.m
This commit is contained in:
1 parent
958c43cce1
commit
30997b56dc
1 file changed
+17
@@ -0,0 +1,17 @@
|
|||||||
|
% https://www.mathworks.com/help/matlab/ref/double.interp1.html
|
||||||
|
|
||||||
|
% we can export the points generated by this code
|
||||||
|
% to a .mat file and call it from simulink to plug into
|
||||||
|
% a PID controller
|
||||||
|
|
||||||
|
% setup vars
|
||||||
|
t = [0, 1, 2, 3, 4];
|
||||||
|
p = [0, -18, -45, -18, 0];
|
||||||
|
|
||||||
|
% generate graph lines
|
||||||
|
querypts = 0:1/16:4;
|
||||||
|
interpts = interp1(t, p, querypts, 'spline');
|
||||||
|
|
||||||
|
% create graph
|
||||||
|
figure
|
||||||
|
plot(t, p,'o', querypts, interpts, ':.');
|
||||||
Reference in new issue
Block a user