I have 2 sets (X and Y) of 9x714
cell arrays where inside the cells consist of various dimension of matrices and empty ones. Cell array X
and Y
are symmetrical for matrix dimensions. I would like to use cellfun
to apply lasso
regression.
[B FitInfo] = cellfun(lasso(X, Y,'CV',4,'Alpha',1));
The response received from Matlab
:
"Error using lasso (line 221). The parameter 'X' must be a real-valued 2D matrix."
All of the matrices inside the cell are real-values. The above function works when run individually by specifying the cell location, for example:
[B FitInfo] = lasso(X{9, 1}, Y{9, 1},'CV',4,'Alpha',1));
Note: the above function is run in single, not using loops.
Please advise. Thank you in advance.