How to solve the the parameter 'SampleTime' must be a real double scalar (period) or a real double vector of length 2 (period, offset).

18 次查看(过去 30 天)
the parameter 'SampleTime' must be a real double scalar (period) or a real double vector of length 2 (period, offset); where period, offset must be finite and non-negative and offset must be less than period.
  10 个评论
Fangjun Jiang
Fangjun Jiang 2024-7-30
In this particular case, class(Ts) being 'single' was the root cause. The solution was to specify the sample time as 'double(Ts)'.

请先登录,再进行评论。

回答(2 个)

Fangjun Jiang
Fangjun Jiang 2022-7-22
编辑:Fangjun Jiang 2023-4-28
This is the cause and it shocked me.
The "Ts" is currently of data type "single". Change it to be "double".

Walter Roberson
Walter Roberson 2022-7-23
移动:Joel Van Sickel 2023-4-27
specify double(Ts) as the Sample Time in the block?

类别

Help CenterFile Exchange 中查找有关 Custom Training Loops 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by