求用Isqnonlin进行非线性拟合问题。
Afficher commentaires plus anciens
公式为 [latex][630.93^(1-a)-x^(1--a)]/(1-a)=ky[/latex]
欲用Isqnonlin进行非线性拟合 p为y;q为x
y为 5 10 15 20 25 x为 125.39 96.45 79.81 60.57 46.30
拟合出 a 与 k
这是我编的程序
function F = myfun3(x)
q=[125.39,96.45,79.81,60.57,46.30];
p=5:5:25; ;
syms m n;
m=1-x(1);
n=x(2);
F=1-[630.93^x(1)-q^x(1)]/(x(1)*x(2)*p)
end %%保存为M文件 %%%%%%%%% %%
命令窗口中输入
clc
tic
x0=[0.2 -1.5];
[x,resnorm]=lsqnonlin(@myfun3,x0)
toc
出现???
Error using ==> optim\private\lsqncommon
User supplied function failed with the following error:
Error: File: C:\MATLAB7\work\myfun3.m Line: 2 Column: 35
Missing variable or function.
Error in ==> lsqnonlin at 147
[x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
求大神们帮忙解决 急急急!!!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Mathematics and Optimization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!