找到你要的答案

Q:programmatic fit in matlab, order of unknowns in fittype options

Q:编程适合MATLAB,在fittype未知命令选项

i'm trying to programmatic fit a function in matlab, and i need to set the upper and lower boundaries of my unknowns. but i don't know in which order i should put them. for an example:

    func = ['heaviside(time).*-2*v.*exp(-a.*time).*sin(sqrt(w^2-a^2).*time+phase)'];
    curve = fittype(func,'independent','time','dependent','volt');
    opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
    opts.Lower = [3000 0 -0.1 100000];
    opts.StartPoint = [4000 1.7 0.05 140000];
    opts.Upper = [5000 3.14 0.1 150000];

but how matlab will know how to match these boundaries to the unknowns?

in the example I've put the boundaries corresponding to the order [a, phase, v, w], but of course matlab didn't read them in that order....

我想适合的项目在matlab的函数,我需要把我的未知数的上部和下部的边界。但我不知道我应该把它们放在哪个顺序。举个例子:

    func = ['heaviside(time).*-2*v.*exp(-a.*time).*sin(sqrt(w^2-a^2).*time+phase)'];
    curve = fittype(func,'independent','time','dependent','volt');
    opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
    opts.Lower = [3000 0 -0.1 100000];
    opts.StartPoint = [4000 1.7 0.05 140000];
    opts.Upper = [5000 3.14 0.1 150000];

但如何在matlab将知道如何匹配这些边界的未知?

在我已经把边界对应的命令[,相,V,W ],但当然MATLAB不按这个顺序读这些的…

matlab