If I change the dimension of the set context to
// Define physical parameters
k1 = 100; // Spring constant of k1 (N/m)
k2 = 50; // Spring constant of k2 (N/m)
b = 10; // Damping coefficient (Ns/m)
m1 = 5; // Mass of m1 (kg)
m2 = 3; // Mass of m2 (kg)
// System Matrices
A = [0, 1, 0, 0;
-(k1 + k2) / m1, -b / m1, k2 / m1, 0;
0, 0, 0, 1;
k2 / m2, 0, -k2 / m2, 0];
B = [0;
1 / m1;
0;
-1 / m2];
C = [1, 0, 0, 0;
0, 0, 1, 0];
D = [0; 0];
// Kalman Filter Parameters
Q = diag([0.01, 0.01, 0.01, 0.01]); // Process noise covariance
R = diag([0.05, 0.05]); // Measurement noise covariance
P0 = diag([0.1, 0.1, 0.1, 0.1]); // Initial error covariance
Then how to debug it. It is hard coded. What is the error now?