Is there any way to put a nlinfit function in a for loop?

2 visualizaciones (últimos 30 días)
Ashkan Rigi
Ashkan Rigi el 14 de Nov. de 2021
Comentada: Sargondjani el 14 de Nov. de 2021
Hello every body. Is there any way to put a nlinfit function in a for loop?
  2 comentarios
Star Strider
Star Strider el 14 de Nov. de 2021
Yes.
Please be a bit more specific about the application and desired result. (With all due respect, an ambiguous question will produce only an ambiguous answer.)
Sargondjani
Sargondjani el 14 de Nov. de 2021
Please be more specific? Are your Y's different data sets, or your X's, or both?
Assume X are 2D matrices stored in a 3D array, and Ys as column vectors in a 2D matrix:
for ii = 1:nn
beta(:,ii) = nlinfit(X(:,:,ii),Y(:,ii),modelfun,beta0)
end
where you should pre-allocate beta.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Matrix Indexing 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