Dynamically change matrices A and B


I am using a MPC to control a race car around a track. The car dynamics are non-linear, thus i linearize at each time step.

I am trying to update the matrices A and B (from linearization) at every time step, but i couldn’t! Whats the proper why of updating these matrices?