From 84e2858776ed151f771ebacbfe5d4c39b5d16f1c Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 15 Mar 2023 20:24:16 +0100 Subject: [PATCH] p3: matlab/p3.m file --- p3/matlab/p3.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 p3/matlab/p3.m diff --git a/p3/matlab/p3.m b/p3/matlab/p3.m new file mode 100644 index 0000000..2d32ca7 --- /dev/null +++ b/p3/matlab/p3.m @@ -0,0 +1,23 @@ +cd ~/src/utb/ak9im/ak9im/p3; + +%% load model +%load('data/task3.slx'); +%load("data/u.csv"); + + +step(1, [2 5 1]) + +%% run the simulation in simulink +len_u = length(u); +len_y = length(y); + +%% save data +% cd ~/src/utb/ak9im/ak9im/p2/data/; +m = [out.u, out.y]; +% writematrix(m, 'data/m.csv') + +%% plot input/output signals. +plot([1:len_u],out.u) +plot([1:len_y],out.y) + +[n d] = c2dm(1, [2 5 1], 1);