Ok, so I am trying to do a global fit of multiple traces to obtain 4 parameters. I have 15 traces that I am trying to fit at the same time using LSQCURVEFIT. Everything works fine if the data in my matrix has an equal number of columns in each of the rows. But, here is the problem. For 6 of the 15 traces, I collected more data. Now, yes I could just delete some of that data so that the number of columns is equal in each row, but my professor wanted more data for the global fit for those 6 traces intentionally. I won't go into detail as to why more data was required for those 6 traces. My question though is how can I do this fit using LSQCURVEFIT if the number of columns for these 6 traces is greater in those 6 rows than the other 9 rows? I'll get errors like index exceeds matrix dimensions (even if the other columns from the other 9 rows is filled with NaN). How can I do this fit with unequal columns in some of my data rows? I read that using cell arrays might work, but I couldn't figure out how with this kind of fit.