You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_fx_poly.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function [f] = spm_fx_poly(x,v,P)
% Normal (bilinear) form equation of motion
% FORMAT [f] = spm_fx_poly(x,v,P)
% x      - state vector
% v      - exogenous cause
% P      - free parameters

    
function [f] = spm_fx_poly(x,v,P)
% Normal (bilinear) form equation of motion
% FORMAT [f] = spm_fx_poly(x,v,P)
% x      - state vector
% v      - exogenous cause
% P      - free parameters
%
% f      - dx/dt
%__________________________________________________________________________

% Karl Friston
% Copyright (C) 2010-2022 Wellcome Centre for Human Neuroimaging

% compute Jacobian from blinear terms
%--------------------------------------------------------------------------
x     = spm_vec(x);
J     = P.A;
for i = 1:length(P.B)
    J = J + P.B{i}*x(i);
end