My research project group is trying to export matlab code as FMU. One of the way we came up with is generating c code from matlab script and export c code as FMU. I am curious if there is any tool for packaging c code as an FMU? If there is not, is there another way to achieve this?
Updating the question after the answer from @mklingn.
I have tried editing with bouncingball.c , but the problem I face is, in every example provided, variables are considered data type as either boolean or double. In my case one of the input is structure, for example my c file generated is
#include "mult.h"
/* Function Definitions */
/*
* Arguments : double u
* double v
* const struct0_T *m
* Return Type : double
*/
double mult(double u, double v, const struct0_T *m)
{
double y;
y = u * v * m->x[2];
/* fcn(u,v ,'parameter1',m,'parameter2',n) */
return y;
}
and .h file generated is
#ifndef MULT_H
#define MULT_H
typedef struct {
char y[6];
double x[6];
} struct0_T;
extern double mult(double u, double v, const struct0_T *m);
#endif
so according to your point 2: such kind of exporting is not possible with FMI version 2.0. Did I understand your point correct?