summaryrefslogtreecommitdiffstats
path: root/templates/traj_cost.m
diff options
context:
space:
mode:
authorYanzhenXiangRobotics <xyz000327@gmail.com>2023-05-10 23:30:01 +0200
committerYanzhenXiangRobotics <xyz000327@gmail.com>2023-05-10 23:30:01 +0200
commit3d6ef58ff1edee6d882a8d9cbe97625ff26afe6e (patch)
tree070832993dd8b63ee2aa70ee6f611d4d139f1d65 /templates/traj_cost.m
parentRevert mistakenly pushed to master (diff)
downloadmpc_pe-3d6ef58ff1edee6d882a8d9cbe97625ff26afe6e.tar.gz
mpc_pe-3d6ef58ff1edee6d882a8d9cbe97625ff26afe6e.zip
Revert to handout
Diffstat (limited to 'templates/traj_cost.m')
-rw-r--r--templates/traj_cost.m6
1 files changed, 0 insertions, 6 deletions
diff --git a/templates/traj_cost.m b/templates/traj_cost.m
index 57566c9..7e0b443 100644
--- a/templates/traj_cost.m
+++ b/templates/traj_cost.m
@@ -8,10 +8,4 @@
function J_Nt = traj_cost(Xt,Ut,Q,R)
% YOUR CODE HERE
- J_Nt=0;
- for i=1:length(Xt(1,:))-1
- a= Xt(:,i)'*Q*Xt(:,i);
- b= Ut(:,i)'*R*Ut(:,i);
- J_Nt=J_Nt+a+b;
- end
end \ No newline at end of file