You need to break down your expressions to something like this:
rows: DOUBLE  rows ',' DOUBLE
columns: rows  rows ';' rows
matrix: IDENTIFIER '.' '{' IDENTIFIER '}' '=' '[' columns ']'
Now you can have a vector<double> for your rows. A vector<
vector<double> > for your columns, and save the result in
your matrix.
Of course, when you get a columns in your matrix, you shoul

You can convert all nan values to zeros using np.nan_to_num() and then
proceed further. Demo:
>>> data
array([[ 5.1, 3.5, 1.4, 0.2],
[ 4.9, 3. , nan, 0.2],
[ 4.7, 3.2, 1.3, nan],
[ nan, 3.1, 1.5, 0.2]])
>>> np.cov(data.T)
array([[ nan, nan, nan, nan],
[ nan, 0.04666667, nan, nan],

The problem seems to be the K = C2^(16/57). Taking the root of a
matrix is not trivial and solutions don't always exist. That's why
MATLAB cannot resolve this expression. Try for example:
A = syms('A',[3,3]); % create 3x3 symbolic matrix
B = A^(1/3); % calculate the 3rd root of A
The result will be
ans = matrix([[a1_1, a1_2, a1_3], [a2_1, a2_2, a2_3], [a3_1, a3_2,
a3_3]])^(1/3)
