How would it be possible to set the length of the input signal for Matlab function block?

2 次查看(过去 30 天)
Hi,
I have used a step block (in simulink) as the input provider for a (embedded) matlab function block.
Inside the editor of the matlab function block, there is a condition which make following trouble,
every time I run the simulink model, an error message occur which say that:
" number of rows of the input signal (step function) is not equal to 50 "
-it should be noted, I am aware that it is a user defined error-
but my problem is,
I don't know how to adapt the length of input signal (step block) to the specified number (50).
Sincerely Yours,
Sahand Radmanesh

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-11-13
Set the Initial Value of the Step block to zeros(1,50) and its Final Value to ones(1,50) to have it produce a signal of length 50.
  2 个评论
sahand
sahand 2012-11-14
Thanks,
With your proposed approach the number of columns (second dimension) changed, But again whether I use zeros(1,50) or zeros(50,1), only the second dimension changes and exported variable to Workspace says that the output is a variable with following specification:
52*50 double
and the number of rows always keeps the same value: 52
What could be done for first dimension to be changed?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by