LSQCURVEFIT Global Fit Unequal Data Question

1 visualización (últimos 30 días)
Kelly McGuire
Kelly McGuire el 3 de Ag. de 2017
Comentada: Torsten el 7 de Ag. de 2017
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.
  6 comentarios
Kelly McGuire
Kelly McGuire el 4 de Ag. de 2017
John D'Errico, could you elaborate on your first sentence, "You don't need to have the same number of points on each curve to make lsqcurvefit work."?
Torsten
Torsten el 7 de Ag. de 2017
Use "lsqnonlin" instead of "lsqcurvefit".
Then you don't need to use "xdata" and "ydata" as direct input for the solver and you can define them as cell arrays.
Best wishes
Torsten.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by