I have the following code:
% Code to import data from .csv files into cell arrays called strain_trans_data, strain_ax_data, and load_data
strain_trans_data = cell2mat(strain_trans_data);
strain_trans_data = strain_trans_data*-1; % trans strain to -trans strain
strain_ax_data = cell2mat(strain_ax_data);
load_data = cell2mat(load_data);
new_trans_data = [];
new_ax_data = [];
new_load_data = [];
regressions = {'File name','y-int axial','slope axial','y-int trans','slope trans','v'};
% Rest of the code...
The code imports data from some .csv files which I analyze by performing a linear regression. To perform the linear regression and to plot the data, I need to convert the cell arrays to matrices. When I import a lot of data (from more than 10 .csv, in my case I have 11 files), strain_trans_data = cell2mat(strain_trans_data); and strain_ax_data = cell2mat(strain_ax_data); work fine, they just convert the cell arrays to matrices. Since there are 11 sets of data, the cell arrays are nx11 and the final matrices are nx11.
For some reason, load_data = cell2mat(load_data); instead eliminates one column so the initial cell array is nx11 and the final matrix is nx10 instead. I tried with other sets of data (smaller than 10) and this problem seems to only occur in this instance. What is strange is that both strain_trans_data = cell2mat(strain_trans_data); and strain_ax_data = cell2mat(strain_ax_data); work fine, it's only the last conversion that gives a problem. Any idea why this might be happening?
Edit: I tried stepping into the cell2mat function to see what was happening and found the step where the problem happens. In the image below m is a nx11 cell
then for some reason it changes to a nx10 double. Could there be a problem with the data in the cell array?

