Re: S-function Builder and Dynamic Arrays




Adrian Suszko wrote:
Does anyone know if the s-function builder can use an array of
unknown size (ie a dynamic array) as input. If so how? There is a
column where you are supposed to specify the row size but if this is
unknown until the simulation runs what value should go there?

You can try putting -1, this the value that simstruc.h defines for the
enum DYNAMICALLY_SIZED which is what you'd use for dynamically sized
inputs. But I doubt the SFunction builder wizard supports this. I'd set
some default size, let the wizard create the SFunction, then edit the C
file manually and recompile it. Search help for the callback routines
that Simulink invokes when executing SFunctions, you'll need to use
these if you specify input port dimensions as DYNAMICALLY_SIZED; you
can use either ssSetInputPortMatrixDimensions or
ssSetInputPortVectorDimension for this.

Good luck,
Ashish.

.



Relevant Pages

  • Re: Opening an already-connected unit with status=unknown
    ... I'd say that the standard comes close to ... contradicting itself here, but not quite. ... It doesn't say "OLD or UNKNOWN". ... you can specify OLD or you can omit the STATUS=, ...
    (comp.lang.fortran)
  • Re: Type of Data Returned by a Function
    ... returned by my functions is "unknown" in the following syntax: ... I *think* I can specify that by doing something like this: ... The only thing I can think of that might have something to do with what you say are phpdoc comments: ...
    (comp.lang.php)
  • Re: NULL = NULL not working
    ... >>I have a proc that can specify a price range if its passed in. ... Think of NULL as an unknown value. ...
    (microsoft.public.sqlserver.mseq)
  • Multi-value in a variable
    ... Have a need to specify a attribute,multivalue in a variable and have ... that work in a dynamic array. ... DYN = 'A' ... but cannot change the CRT DYNstatement. ...
    (comp.databases.pick)
  • S-function Builder and Dynamic Arrays
    ... Does anyone know if the s-function builder can use an array of ... unknown size (ie a dynamic array) as input. ... unknown until the simulation runs what value should go there? ...
    (comp.soft-sys.matlab)