| 5 | 1/1 | 返回列表 |
| 查看: 1525 | 回復(fù): 10 | |||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | |||
[求助]
matlab非線性擬合計算求助
|
|||
|
求助高手,我的擬合程序主體如下 16行 fun=inline('b(1)*(x1.^b(2))*(x2.^b(3))*(x3.^b(4))-b(5)*(x1.^b(6))*(x4.^b(7))*(x5.^b(8));','b','x'); 17行 [b,r,j]=nlinfit(x,y,fun,b0); 18行 b %最佳參數(shù) 19行 R=sum(r.^2) 但總是出錯 ??? Error using ==> nlinfit at 114 The inline model function generated the following error: Error using ==> inlineeval at 15 Error in inline expression ==> b(1)*(x1.^b(2))*(x2.^b(3))*(x3.^b(4))-b(5)*(x1.^b(6))*(x4.^b(7))*(x5.^b(8)); ??? Error using ==> eval Undefined function or variable 'x1'. Error in ==> exmp1 at 17 [b,r,j]=nlinfit(x,y,fun,b0); 求高手幫忙看看錯在哪里 |
無蟲
彩色掛圖
![]() |
專家經(jīng)驗: +2 |

送鮮花一朵 |
你好,我改了一下,原來的錯誤提示沒有了。 改后 x(:,1)=[..].; x(:,2)=...; x(:,3)= ; x(:,4)= ; x(:,5)= ; x=[x(:,1)' x(:,2)' x(:,3)' x(:,4)' x(:,5)']; y= ; b0=[5.687 2143 0.0970 0.1051 4.585 122.6 0.1140 0.1159]'; %初始參數(shù)值 fun=inline('b(1)*(x(:,1).^b(2))*(x(:,2).^b(3))*(x(:,3).^b(4))-b(5)*(x(:,1).^b(6))*(x(:,4).^b(7))*(x(:,5).^b(8))','b','x'); [b,r,j]=nlinfit(x,y,fun,b0); b %最佳參數(shù) R=sum(r.^2) 但是還是有別的提示 ??? Error using ==> nlinfit at 128 MODELFUN should return a vector of fitted values the same length as Y. Error in ==> exmp1 at 11 [b,r,j]=nlinfit(x,y,fun,b0);請教一下這是怎么回事 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 288求調(diào)劑 一志愿哈工大 材料與化工 +19 | 洛神哥哥 2026-03-31 | 19/950 |
|
|---|---|---|---|---|
|
[考研] 一志愿北京科技大學085601材料工程英一數(shù)二初試總分335求調(diào)劑 +4 | 雙馬尾痞老板2 2026-03-31 | 4/200 |
|
|
[考研] 086000生物與醫(yī)藥298調(diào)劑求助 +3 | 元元青青 2026-03-31 | 5/250 |
|
|
[考研] 299求調(diào)劑 +8 | 嗯嗯嗯嗯2 2026-03-27 | 8/400 |
|
|
[考研] 304求調(diào)劑 +8 | 素年祭語 2026-03-31 | 11/550 |
|
|
[考研] 求調(diào)劑推薦 材料 304 +18 | 荷包蛋hyj 2026-03-26 | 18/900 |
|
|
[考研] 254材料與化工求調(diào)劑 +3 | 翰冬林楠 2026-03-30 | 4/200 |
|
|
[考研] 086000生物與醫(yī)藥 初試274求調(diào)劑 +4 | 小叮當來了 2026-03-30 | 4/200 |
|
|
[考研] 354求調(diào)劑 +3 | lxb598 2026-03-31 | 4/200 |
|
|
[考研] 287求調(diào)劑 +17 | land xuxu 2026-03-26 | 17/850 |
|
|
[考研] 22408 359分調(diào)劑 +4 | Qshers 2026-03-27 | 8/400 |
|
|
[考研] 370求調(diào)劑 +3 | 080700調(diào)劑 2026-03-30 | 3/150 |
|
|
[考研] 342求調(diào)劑 +4 | 加油a李zs 2026-03-26 | 4/200 |
|
|
[考研] 求調(diào)劑 +7 | 青春裁為三截 2026-03-29 | 7/350 |
|
|
[考研] 332求92調(diào)劑 +8 | 蕉蕉123 2026-03-28 | 8/400 |
|
|
[考研] 071000生物學求調(diào)劑,初試成績343 +7 | 小小甜面團 2026-03-25 | 7/350 |
|
|
[考研] 材料求調(diào)劑一志愿哈工大324 +7 | 閆旭東 2026-03-28 | 9/450 |
|
|
[考研] 086502化學工程342求調(diào)劑 +6 | 阿姨復(fù)古不過 2026-03-27 | 6/300 |
|
|
[考研] 265求調(diào)劑 +8 | 小木蟲085600 2026-03-27 | 8/400 |
|
|
[考研] 341求調(diào)劑 +7 | 青檸檬1 2026-03-26 | 7/350 |
|