-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_results_ext.m
More file actions
62 lines (50 loc) · 1.16 KB
/
plot_results_ext.m
File metadata and controls
62 lines (50 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Plots
function plot_results(t, x, ref, U, U_track, U_corr)
subplot(4,2,1)
plot_results(ref, x)
subplot(4,2,3)
plot(t, U(:, 1))
xlabel('t [s]')
ylabel('input w_r [rad/s]')
subplot(4,2,4)
plot(t, U(:, 2))
xlabel('t')
ylabel('input w_l [rad/s]')
hold off
subplot(4,2,7)
plot(t, U_track(:, 1))
xlabel('t [s]')
ylabel('tracking input w_r [rad/s]')
subplot(4,2,8)
plot(t, U_track(:, 2))
xlabel('t [s]')
ylabel('tracking input w_l [rad/s]')
ex = ref(:, 1) - x(:, 1);
ey = ref(:, 2) - x(:, 2);
subplot(8,8,5)
hold on
xlabel('t [s]')
ylabel('x [n]')
plot(t, ref(:, 1), "DisplayName", "X_{ref}");
plot(t, x(:, 1), "DisplayName", "X");
legend()
hold off
subplot(8,8,6)
plot(t, ex);
xlabel('t')
ylabel('x error')
subplot(8,8,13)
hold on
xlabel('t')
ylabel('y')
plot(t, ref(:, 2), "DisplayName", "Y_{ref}");
plot(t, x(:, 2), "DisplayName", "Y");
legend()
hold off
subplot(8,8,14)
plot(t, ey);
xlabel('t')
ylabel('y error')
subplot(4, 4, 4);
plot_error(t, ref, x)
end