Using variable size matrices in Simulink

조회 수: 1 (최근 30일)
Ryan
Ryan 2013년 7월 26일
Simulink gurus!
I have a model that uses a triggered subsystem to create a new node when a set of logic conditions is met. The new node is stored in a workspace variable using the Signal to Workspace block in array format. Once that node is added, I need to use the whole, updated matrix from the workspace to run another function within the triggered subsystem, but I cannot get it to propagate the matrix beyond the one specified when I initialize the simulation. I've tried using the From Workspace, Signal from Workspace, Triggered from Workspace, and Constant blocks, and the array, structure, structure with time, and timeseries formats with no luck. Any thoughts? Thanks!

채택된 답변

Guy Rouleau
Guy Rouleau 2013년 7월 26일
You are going in the wrong direction. Going back in the workspace is not the good approach.
Instead, create a vector in Simulink with the maximum dimension you expect for your vector. Using an assignment block, fill it. Keep it store using a Unit Delay, and gab the "filled" part using a Selector block to send to your function.
  댓글 수: 1
Ryan
Ryan 2013년 7월 30일
The size of the matrix is unknown at the beginning of the simulation, but I set it to be arbitrarily long and it worked as you suggested. Thanks for your help!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Buffers, Switches, and Counters에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by