필터 지우기
필터 지우기

Simulink and Variable Sized Global Variables

조회 수: 3 (최근 30일)
Superfish
Superfish 2012년 1월 9일
I have a M-Function which reads some data at each time step, stores it in a growing dictionary (A = [A; a], where 'a' is the new data) and then uses it to produce an output.
I would like to use this function in Simulink, however I cannot see a way to create a variable sized global variable that A needs to be.
Could someone please point me in the correct direction?

채택된 답변

C.J. Harris
C.J. Harris 2012년 1월 9일
I don't believe you can do this, at least not in an easy way. You might be better off looking into the possiblity of initialising A to its maximum size, and then selecting the part of the vector you need to use at each timestep.

추가 답변 (1개)

Guy Rouleau
Guy Rouleau 2012년 1월 10일
Simulink supports variable size signals. However you need to specify a maximum size.
This topic is covered here:
If you want, you can use variable size also in the MATLAB Function block:
  댓글 수: 1
Superfish
Superfish 2012년 1월 10일
Yeah, but it doesn't seem to work for global variables as it looks like data stores can't store variable data.

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

카테고리

Help CenterFile Exchange에서 Interactive Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by