Forums

S Function Builder - C Mex files

Started by lee_xmen October 16, 2004


Hi ,

I'm working on C-MEX files ,using S-Function Builder ....
A very basic problem,.

I have two input arrays u0[5] and u1[3] and the output is y0[5],.
computing the output via

for(i=0;i<5;i++)
for(k=0;k<3;k++)
y0[i] = u0[i]+ u1[k]; //just a test code

With this i'm able to create the .dll file for the S-function
builder,...but when i give inputs,i get the below error message :

"S-function block 'test2sfun/S-Function Builder' does not have
mdlSetInputPortDimensionInfo (mdlSetInputPortWidth) and
mdlSetOutputPortDimensionInfo (mdlSetOutputPortWidth) methods. Since
the block does not follow the default rules, it cannot use Simulink
default methods to set its port widths or dimensions. Please update
the S-function by adding the above methods. You can find more
information about these methods in the 'Writing S-functions' document"

Can somebody please tell me wht could be the problem ..

Thanks,

mittu





Hi,
You have to define the number of inputs in the
configuration file before making its as an s-function.
I guess, no need to change the defau;lt value of the
output.
Regards,
-SaiRamesh.

--- lee_xmen <> wrote:

>
>
> Hi ,
>
> I'm working on C-MEX files ,using S-Function Builder
> ....
> A very basic problem,.
>
> I have two input arrays u0[5] and u1[3] and the
> output is y0[5],.
> computing the output via
>
> for(i=0;i<5;i++)
> for(k=0;k<3;k++)
> y0[i] = u0[i]+ u1[k]; //just
> a test code
>
> With this i'm able to create the .dll file for the
> S-function
> builder,...but when i give inputs,i get the below
> error message :
>
> "S-function block 'test2sfun/S-Function Builder'
> does not have
> mdlSetInputPortDimensionInfo (mdlSetInputPortWidth)
> and
> mdlSetOutputPortDimensionInfo
> (mdlSetOutputPortWidth) methods. Since
> the block does not follow the default rules, it
> cannot use Simulink
> default methods to set its port widths or
> dimensions. Please update
> the S-function by adding the above methods. You can
> find more
> information about these methods in the 'Writing
> S-functions' document"
>
> Can somebody please tell me wht could be the problem
> ..
>
> Thanks,
>
> mittu >
>

_______________________________