2017-02-21 135 views
0

我試圖擬合模型將數據與3個變量和4個paramters如下擬合的模型(以下this Matlab的示例):錯誤與在Matlab

ft = fittype(@(a,b,c,d,x,y,z) a*(x.^b).*(y.^c).*(z.^d),... 
'independent',{'x','y','z'},'dependent',{'w'},'coefficients',... 
{'a','b','c','d'}) 

其中a, b, cd需要提供用於評估給出的數據爲x,y,z。但是Matlab給了我一個錯誤,並且不允許我創建fittype對象。錯誤讀取:

Expression @(a,b,c,d,x,y,z) a*(x.^b).*(y.^c).*(z.^d) is not a valid MATLAB expression, has non-scalar coefficients, or cannot be evaluated: 
Not enough inputs to FITTYPE function. 

我也看了thisthis問題在計算器上,但並沒有完全理解我要去錯在何處。

回答

0

如果您嘗試使用此類型,它將執行命令;

ft = fittype(@(a,b,c,x,y) a*(x.^b).*(y.^c),... 
'independent',{'x','y'},'dependent',{'w'},'coefficients',... 
{'a','b','c'}) 

在你的命令類型中,有太多的表達式不能被Matlab處理。 fittype函數的「獨立」部分只需要1對。

+0

那麼在Matlab中有哪些選擇? – Abhinav