Specifying discrete sample time for variable-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.
채택된 답변
추가 답변 (1개)
Kaustubha Govind
2012년 2월 13일
0 개 추천
As TAB indicates in his/her comment, it is likely that the input signal has a continuous sample time. The Assignment block inherits that sample time (-1 means inherited sample time). The solver configuration does not affect the fact that your signal is continuous.
댓글 수: 5
sst
2012년 2월 13일
Kaustubha Govind
2012년 2월 14일
A sample-time of Inf is a constant sample-time - perhaps variable-size signals are strict w.r.t requiring a discrete sample time. Does the error go away when you set a constant discrete time on your constant blocks? You can define a variable in the workspace and set that variable as the value for all your parameters.
sst
2012년 2월 14일
Kaustubha Govind
2012년 2월 14일
If all sources specify -1 as sample-time, then I think it should indeed use the solver step-size as the sample-rate. Could you try turning on Format->Sample Time Colors. Then observe if there are any blocks with continuous sample time (black lines).
sst
2012년 2월 14일
카테고리
도움말 센터 및 File Exchange에서 Signal Import and Export에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!