필터 지우기
필터 지우기

Simulink write to array index

조회 수: 11 (최근 30일)
Brecht Vermeulen
Brecht Vermeulen 2018년 7월 20일
댓글: Antony Smith 2022년 5월 26일
Goodmorning,
Which block should be used to write to a specific index of an array in Simulink.
Eg. I have a signal with an array [2, 1, 8, 5] and I want to write a 2 to index 3, keeping the other values equal. This should result in an array [2,1,3,5].
Should this really be done by a matlab function?
Kr, BV

답변 (2개)

Birdman
Birdman 2018년 7월 20일
Of course it can be done. Check the attached files.
  댓글 수: 1
Antony Smith
Antony Smith 2022년 5월 26일
I s there really no 'inverse' block to the "Index Vector" block??
Seems like quite an oversight on behalf of simulink functionality?

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


TAB
TAB 2018년 7월 26일
편집: TAB 2018년 7월 27일
Use Assignment block.
OR
Split the array signal using Demux. Then connect the all (except desired index to change) outputs to Mux. Connect other signal at desired index.

카테고리

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

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by