필터 지우기
필터 지우기

Accessing array of structure datatype using simulink

조회 수: 1 (최근 30일)
Sneha Patne
Sneha Patne 2020년 11월 10일
댓글: Sneha Patne 2020년 11월 11일
Hello,
I'm am observing issue with using a for loop iterator with selector block. The For Iterator is looping from i= 0, i<5, i++ and the iteration variable (i) I'm passing it to selector block index through index vector port. The input to U of selector block is an array bus of size [1 42] whose datatype is structure of 4 elements. I need to loop through i value for accessing array elements. Screenshot is attached for simulink implementation and generated code.
In generated code, the index is always 0 even though the for loop is generated in the code.

답변 (1개)

Karthik Ravishankar
Karthik Ravishankar 2020년 11월 10일
Are you sure, the for iterator should be zero based? Matlab arrays are 1 based.
  댓글 수: 1
Sneha Patne
Sneha Patne 2020년 11월 11일
Yes, same output for when I changed to 1 based as well.

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

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by