Hi Marios,
There are multiple errors in your script.
First, you are using C_t and K_t variables inside the function calc_AA_mat. These variables are not defined globally in your script, therefore when you are trying to use these variables inside the functions, their value is empty. Hence, it is throwing error stating "Incorrect dimensions for matrix multiplication". So to resolve this error, declare these variables as global at the top of the script like the other global variables.
Second, you are using LAMFWM function in the ode45 as function handle. You are not supposed to put that in quotes. You should use @functionName syntax there.
[t,x] = ode45(@LAMFWM,t_range,Y0);
You can refer to the following link for the same:
Also, use clc and clear all to clear the MATLAB Command Window and all the variables in the workspace.
I hope this helps.