Simulink write to array index

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

Risposte (2)

TAB
TAB il 26 Lug 2018
Modificato: TAB il 27 Lug 2018

2 voti

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.
Birdman
Birdman il 20 Lug 2018

1 voto

Of course it can be done. Check the attached files.

1 Commento

I s there really no 'inverse' block to the "Index Vector" block??
Seems like quite an oversight on behalf of simulink functionality?

Accedi per commentare.

Prodotti

Release

R2016b

Richiesto:

il 20 Lug 2018

Commentato:

il 26 Mag 2022

Community Treasure Hunt

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

Start Hunting!

Translated by