数学建模社区-数学中国

标题: asamin在matlab里,怎么总是提示出错??? [打印本页]

作者: 深叶子    时间: 2014-8-19 19:13
标题: asamin在matlab里,怎么总是提示出错???
疑问:
3 c- ~, M) w- d: s6 K& V
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”- T5 c2 \. W& d3 N& y) h
Error in ==> HestonASACalibration at 147 U& F5 [5 h& S+ {3 o5 N
asamin('set','test_in_cost_func',0)
( y+ T& X; x5 m! R' Z6 F. N我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???
6 ]: _* U, Q% a+ @6 z. {0 N7 D$ C* |% N: R7 l: \$ l3 }4 w
完整程序5 n/ i- C3 c% z! E3 R
clear;4 Y8 B' n9 g( h; f3 u7 G
global OptionData;
2 w5 D" ~6 A/ V6 Y global NoOfOptions;% B8 E4 _9 o8 L
global NoOfIterations;
# D. p( X4 U4 Y' e7 p) c! t global PriceDifference;! Y) l# n! g1 b0 I/ w( m2 K9 I
global ObjectiveFunc;8 I; ^$ Y/ w: @( M) C* I" v1 q# B% @
NoOfIterations = 0;5 C5 S9 }. J4 {% s9 |
%OptionData = [r,T,S0,K,Option Value,bid,offer]
1 c! ]7 n" a2 ?8 n. d* s$ W Size = size(OptionData);2 D3 _: `' a1 ~2 ~" _* @. Z
NoOfOptions = Size(1);" m7 J  A1 H- R/ a
%input sequence in initial vectors [kappa,theta,sigma,rho,v0]7 T9 n; }3 d6 l) S8 ~
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
! q/ Z3 b6 z4 m lb = [0 0 0 -1 0];ub = [10 1 5 0 1];' c0 u" P; S. c2 `" l0 Y
asamin('set','test_in_cost_func',0)
, o0 M* n- i0 l0 A6 N) I" p# Q tic;2 M  P8 X, E2 {
[fstar, xstar, grad, hessian, state] = asamin('minimize',...: P5 g7 m3 E  M6 J- ?( y
                  'HestonCostFunc',x0',lb',ub',-1*ones(5,1));& m) x. [: I7 N- E9 U* N
toc;       %秒表计时器, ?% ]% {! r2 o9 Y, s
出错程序6 O* B; ^, ~2 [/ G
asamin('set','test_in_cost_func',0)
0 f! q2 v2 I/ V4 n5 G, t1 q运行提示错误为:
& P) U0 Y) S+ H2 d+ c# T' V??? Undefined function or method 'asamin' for input arguments of type 'char'.
作者: madio    时间: 2014-8-20 07:51
我这里没有搜到这个函数?是不是你新安装的工具箱中的函数?如果有这个函数的,就是你输入的参数的类型不对,它不接受char类型的参数
作者: 深叶子    时间: 2014-8-20 18:52
madio 发表于 2014-8-20 07:51
' H1 N$ F0 W* o& u+ V我这里没有搜到这个函数?是不是你新安装的工具箱中的函数?如果有这个函数的,就是你输入的参数的类型不对 ...
% [# y  [+ @$ {: @- ]
我知道原因了,ASAMIN是一个连接ASA与MATLAB 的一个程序包,也就是将C程序与MATLAB连接的接口吧,我没安装ASAMIN程序包,所以 ……3 [& b/ C) r# y5 p- ^( @, s
不过还是谢谢你!




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5