From 30997b56dc7924c207477b13f021b65f1e0ac50c Mon Sep 17 00:00:00 2001 From: "jazz (gitea)" Date: Tue, 7 Jul 2026 13:52:59 -0500 Subject: [PATCH] add lkneeExample.m --- dat/lkneeExample.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dat/lkneeExample.m b/dat/lkneeExample.m index e69de29..0d55c09 100644 --- a/dat/lkneeExample.m +++ b/dat/lkneeExample.m @@ -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, ':.'); \ No newline at end of file