MATLAB: Specifying discrete sample time for variable-size signals

assignmentdiscretefixed-stepsample timesimulinkvariable-size signals

Hi, I am trying to use the inherit sample time setting (-1) for the Assignment block, using a variable-size signal as an index vector coming from an external source. I have selected the following options for the model:
Solver Type: Fixed Step Solver: discrete (no continuous states) Start time: 0.0 Stop Time: Inf Fixed-step size (fundamental sample time): 0.001s
When I try to update the model, I get the following error
The signal at input port 3 of '…/Assignment1' is a variable-size signal with a nondiscrete sample time. The sample time for any variable-size signal must be discrete
Even though I have specified this in the simulation configuration parameters section, why am I still getting this error message? The message goes away if I explicitly specify the sample time as 0.001 instead of -1. Any help would be greatly appreciated.
Running MATLAB R2010bSP1 on Windows XP SP3 (32-bit)
Thanks, Sundeep.

Best Answer

Hi Kaustubha, while the variable-size signal was indeed a discrete sample time signal, the main input signal (In1) to the assignment block was not. By inserting a rate transition block, I was able to convert that continuous sample time signal to a discrete one, and make the error go away. My guess is that the error was pointing to that continuous signal. Thanks for your help though!