Using fitnlm with multiple predictor variables

14 ビュー (過去 30 日間)
Joshua Chambers
Joshua Chambers 2017 年 6 月 1 日
回答済み: Image Analyst 2021 年 11 月 21 日
I am trying to perform non linear regression using 4 independent variables and a 2-term exponential model. I am using the following section of code:
X = [x1 x2 x3 x4];
b = [1 1 1 1];
x = ones(size(X));
modelfun = @(b,x) b(1,:).*exp(b(2,:).*x) + b(3,:).*exp(b(4,:).*x);
beta0 = ones(4,1);
However, I keep getting an error explaining that modelfun returns a vector of 4 columns where it should be 1 column.
I have tried as many variations of modelfun as a I can think of, can someone help?
  1 件のコメント
Eric Garr
Eric Garr 2021 年 11 月 21 日
Did you ever figure out a solution?

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2021 年 11 月 21 日

カテゴリ

Help Center および File ExchangeNonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by