全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
4181 2
2011-09-03
各位编程高手,请教这个matlab程序,如何运行或者修改,谢谢!具体为:
function [ x, fval, n,g,p,LI,GI,Fw,mP,LR,GA,mAgg,AN,A,W,YOverII,LSTIIP1Onu,JPLow,JP,II,Y,LS ] = jmpCalibrate
    clear;
    global beta nu T gN GN
    beta = 99/100;
    nu = 2;
    T = 80;
    gN = 0.003111562156600730;
    GN = exp(gN);
    start = [0.0763661582373014;10.5450641571198;0.0452908924969530;160.961133865592;];
    % start = [ 0, 1/2, 1/6, 13, 1/20, 1/40, 40 ]';
    jmpToMin( start )
    % jmpConstraints( start )
    % [ x, fval ] = fmincon( @jmpToMin, start, [], [], [], [], zeros( 1, 7 )', [ 1, 1, 1, Inf, 1, 1, Inf ]', @jmpConstraints2, optimset( 'Algorithm', 'interior-point', 'Display', 'iter', 'MaxFunEvals', 1000000, 'MaxIter', 1000000, 'UseParallel', 'never', 'FinDiffType', 'central' ) );
    cmaes_opts = cmaes( 'defaults' );
    cmaes_opts.CMA.active = 1;
    cmaes_opts.PopSize = 2 * 4 * 4;
    cmaes_opts.Restarts = 0;
    cmaes_opts.LBounds = zeros( 1, 4 )';
    cmaes_opts.UBounds = [ 1, Inf, 1, Inf ]';
    [ ~, ~, ~, ~, ~, BestEver ] = cmaes( 'jmpToMin', start, 0.4, cmaes_opts ); % [], [], [], [], zeros( 1, 6 ), [ 1, 1, Inf, 1, 1, Inf ], @jmpConstraints, optimset( 'Algorithm', 'sqp', 'Display', 'iter', 'MaxFunEvals', 1000000, 'MaxIter', 1000000, 'UseParallel', 'always', 'TypicalX', start, 'FinDiffType', 'central', 'DiffMaxChange', 1e-6 ) );
    x = BestEver.x;
    fval = BestEver.f;
    [n,g,p,LI,GI,Fw,mP,LR,GA,mAgg,AN,A,W,YOverII,LSTIIP1Onu,JPLow,JP,II,Y,LS] = jmpDisplay( x );
    fprintf( 1,'n:=%.20f; g:=%.20f; p:=%.20f; LI:=%.20f;\n', n, g, p, LI );
end

运行后出现如下错误:
??? Error: File: C:\Documents and Settings\Administrator\桌面\pppp_files\main\jmpCalibrate.m Line: 20 Column: 8
Expected a variable, function, or constant, found ",".

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2011-9-3 10:35:31
这是一个function,可以调用,但不能单独运行,
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2011-9-4 00:20:20
怎么调用啊,不会啊,说得详细点啊,谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群