MATLAB Answers

Simulink write to array index

15 ビュー (過去 30 日間)
Brecht Vermeulen
Brecht Vermeulen 2018 年 7 月 20 日
編集済み: TAB 2018 年 7 月 27 日
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

  0 件のコメント

Sign in to comment.

回答 (2 件)

Birdman
Birdman 2018 年 7 月 20 日
Of course it can be done. Check the attached files.

  0 件のコメント

Sign in to comment.


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.

  0 件のコメント

Sign in to comment.

製品


リリース

R2016b

Translated by