필터 지우기
필터 지우기

Simulink variable signal size

조회 수: 1 (최근 30일)
vivek patel
vivek patel 2022년 10월 5일
편집: vivek patel 2022년 10월 5일
I am trying to implement a logic, were i would have a variable signal size data with me.
Whenver the simulink model is executed then the there would be new set of data received, this data either needs to be updated in the existing values in the variable size signal or needs to be appended to the existing variable signal size.
I am not sure quick how to acheive this, i tried using the below pattern, where newData is getting appended to the prevData, but it does not work, as to get the previous data i am using a delay block, which gives me error as the size of the delay block cannot be propogated. Here i am just appending the data without any condition, but ofcourse in the real world i would make sure that the DataOfInterest is having max bound of some number and not take newData later.

답변 (1개)

Benjamin Thompson
Benjamin Thompson 2022년 10월 5일
You cannot change the size of signals during a simulation run. That is what your MATLAB function is doing, trying to add new data on each function call.
  댓글 수: 1
vivek patel
vivek patel 2022년 10월 5일
편집: vivek patel 2022년 10월 5일
Can you please explain then why in the sldemo_varsize_basic, we can use switch, so the size of the b is changing during a simulation run isn't it ? Then why it is okay but not what i am trying to do ? I think i am missing some silly thing when we say "size of signals during a simulation run" cannot be changed.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by