Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Not enough input arguments?

Subject: Not enough input arguments?

From: Peter

Date: 1 Oct, 2002 11:35:48

Message: 1 of 1


Now I am able to compile my own small wrapper, which calls the mlf interface
function of the converted .c file. Here is the steps I have done:
1) 'mcc -m file1.m file2.m' under MATLAB: to convert my m files to c files,
the generated object file 'file1' worked fine under Unix.
2) 'mbuild mymain.c *.c' under Unix: mymain.c is my small wrapper (see code
below), to compile my own .c file to call mlf interface function from
file1.c generated in 1).

Here is the problem: the compile worked, except long list of warnings, but
when I try to execute the generated 'mymain' object file, I got error:
ERROR: Not enough input arguments


Can anybody point me out what's wrong here and how to fix it?

The code of 'mymain.c' is as following:
#include <stdio.h>
#include "matlab.h"

void mlfFile1(void);
void main(void)

The partial code of generated 'file1.c' is as following:
void mlfFile1(void) {
    mlfEnterNewContext(0, 0);
    mlfRestorePreviousContext(0, 0);
static void Mfile1(void) {

The original file1.m looks as following:
function file1
data6 = dlmread('', ' ');
vlb = zeros(1,8)+1e-4;
vub = vlb+100;
x0 = [.3,.2,.1,0.1, 0.1, 0.07, 0.56, 0.64];
for k=1:256
.. calculateing ...
x = constr('file2',x0,[],vlb,vub,[],data6,p);
y=file2(x, data6, p);

and file2.m is the object function.

Was I wrong to convert my .m files to stand-along applications? Should I
convert them to MEX files? What I want is to be able to call file1.c
function (mlfFile1()) in my own c code so that I can apply MPI or
multi-thread to the function.


Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us