필터 지우기
필터 지우기

Is it possible to input an N-by-M signal (matrix) into into a State Flow Chart?

조회 수: 2 (최근 30일)
I have an N-by-M matrix that I am trying to pass as an input into a State Flow Chart, but the Model errors out when setting the data Size inside the Model Explorer to be [MxN]. My temporary solution is reshaping the matrix to a 1-by-NxM array before entering the chart, and then reshaping again inside, but I would really like to pass the entire matrix for other reasons. Any ideas?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2018년 4월 30일
In a Stateflow chart, add an "Input from Simulink" called "data", define the size as [5,5]. Add an "Output to Simulink" called "data1", add a default transition, specify the action as {data1=data(2,2);}
Outside the Stateflow chart, add a Constant block, specify the value as "magic(5)" or "rand(5)", connect, run simulation, observe the output.

추가 답변 (1개)

CP
CP 2018년 4월 30일
Thank you.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by