필터 지우기
필터 지우기

stateflow error : There is no full assignment to data

조회 수: 90 (최근 30일)
Amish Rughoonundon
Amish Rughoonundon 2018년 9월 15일
편집: Amish Rughoonundon 2018년 10월 1일
Hi, using matlab 2013b. I am getting this error in stateflow
There is no full assignment to data 'badRvsPowerDetectedCount' (#757) in the chart even though it is being used here. Note that an element-wise assignment, like "y(1) = 1", does not count as a full assignment.
For Stateflow chart locals and outputs, a full assignment is needed even if the type/size/complexity has been fully specified in the Model Explorer. You can leave out a full assignment for structure types as long as the type is fully specified in the model explorer as "Bus: typename" and not left inherited or parameterized.
I am trying to index into an array and assign 1 element of the array in my chart. Any help would be highly appreciated
I have attached the stateflow chart. Thanks, Amish

답변 (2개)

Amish Rughoonundon
Amish Rughoonundon 2018년 10월 1일
편집: Amish Rughoonundon 2018년 10월 1일
Sorry for the late reply. The issue might have been two fold for me. I don't know which one helped exactly
1) In model explorer, where variables are initialized, arrays have to be initialized with a vector size [1 x] instead of just x. It's in the picture attached (matlab vector initialization).
2) In my chart itself, I initialized the vector like this in a reset state. It's in the picture attached (matlab vector reset)
I also attached the new chart that works for me. Hopefully this helps other people. Amish

Pinkesh Narsinghani
Pinkesh Narsinghani 2018년 9월 24일
For Stateflow to properly initialize all data members, a full-vector initialization must be performed.
If the array is named X, this requires a statement of the form: X = ...
Even if every data member is initialized explicitly (X(1)=2; X(2)=7), Stateflow requires full-vector initialization to guarantee the entire vector is initialized.
  댓글 수: 1
Dawn Ivan
Dawn Ivan 2018년 9월 24일
편집: Dawn Ivan 2018년 9월 24일
Dear Pinkesh, I have a similar problem and even after initializing the vector in the model explorer,the same error persists.What would be the possible solution?

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

카테고리

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