Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

ydata in lsqcurvefit not being updated

1 Ansicht (letzte 30 Tage)
William
William am 11 Nov. 2012
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I am having some bizarre goings-on with lsqcurvefit. The calling program loads the vector being used as "ydata". It calls lsqcurvefit with the function result coming from an anonymous function. However, the ydata that ends up being used is from a previous run of the program! I have no idea how that is happening. Any ideas on what is going on?

Antworten (1)

Star Strider
Star Strider am 11 Nov. 2012
Without knowing more (posting some of your code would help) it's difficult to say exactly what the problem is. I suggest that just before you load the new values for ‘xdata’ and ‘ydata’, you set your data arrays to the empty array:
xdata = [];
ydata = [];
Otherwise, be sure you're actually not loading your previous run data. If they're in a matrix, you could have a matrix indexing error, so the vector you believe you are loading is not the one you are actually loading.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by