p3: matlab/p3.m file

This commit is contained in:
leo 2023-03-15 20:24:16 +01:00
parent ac4a8551d2
commit 84e2858776
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

23
p3/matlab/p3.m Normal file

@ -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);