Is there any way to put a nlinfit function in a for loop?
3 views (last 30 days)
Show older comments
Ashkan Rigi on 14 Nov 2021
Commented: Sargondjani on 14 Nov 2021
Hello every body. Is there any way to put a nlinfit function in a for loop?
Sargondjani on 14 Nov 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)
where you should pre-allocate beta.
Find more on Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!