zhixiaoma 发表于 2011-3-29 13:40

请问关于优化函数fmincon的问题报错未定义X

出错代码:
% do a quasi-Newton maximization on the windowed signal
% a longer window is useful here.
Z = 4;
rt = round(t);
if ( (rt-Z*M < 1) & (rt+Z*M > N) )
xx = ;
elseif (rt-Z*M < 1)
xx = ;
elseif (rt+Z*M > N)
xx = ;
else
xx = x(rt-Z*M:rt+Z*M);
end

opt = foptions;
P =fmincon('f_chirp',,xx,,,'g_chirp',opt);
P(1) = rt + P(1) - (Z*M+1);
P(2) = mod(P(2),2*pi);
if (verbose) fprintf(1,'constr -> t = %7.2f, f = %4.2f, c = %7.4f, d = %6.2f\n', P), end

出错提示:
??? Error using ==> fmincon at 504
FMINCON cannot continue because user supplied objective function failed with the following error:
Input argument "x" is undefined.

Error in ==> best_chirplet at 90
P =fmincon('f_chirp',,xx,,,'g_chirp',opt);

Error in ==> find_chirplets at 52
P = best_chirplet(e, level, M, verbose, c, d);

Error in ==> demo_chirplets at 30
P1 = find_chirplets(xn,3);

zhixiaoma 发表于 2011-3-29 13:40

非常感谢 卡在这里

qibbxxt 发表于 2011-3-30 11:12

能不能给出完整的代码啊?

meiyongyuandeze 发表于 2011-3-31 09:15

x没有定义吧

春田花花 发表于 2013-9-12 15:43

能不能分享下chirplets.m find_chirplets.m best_chirplet?

奶奶个熊 发表于 2013-9-26 16:33

可以完成代码?
页: [1]
查看完整版本: 请问关于优化函数fmincon的问题报错未定义X