远帆 发表于 2006-9-6 22:53

为什么输入变量个数不对

mex文件如下:
void main0(double *input,double output)
{}
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
{
    double *input,*output;
        int mrows0,ncols0;
...
}

.m文件如下:
clc;
clear;
options=optimset('largescale','off','diagnostics','off','display','iter','tolx',1e-6,'tolfun',1e-6,'MaxFunEvals',500);
input0=;
xiajie=;
shangjie=;
mex fourthmex.c
=fmincon('dandaofun',input0,[],[],[],[],xiajie,shangjie,[],options);

function =dandaofun(input);
=fourthmex(input);

出来的结果是:
FMINCON cannot continue because user supplied objective function failed with the following error:
Five inputs required.
Error in ==> youhua at 9
=fmincon('dandaofun',input0,[],[],[],[],xiajie,shangjie,[],options);

求牛人解答   不胜感激

AaronSpark 发表于 2006-9-8 02:33

估计是vb不能识别空矩阵[]
页: [1]
查看完整版本: 为什么输入变量个数不对