How to decatenate or discatenate (opposite of concatenate) a vector in simulink?
Mostra commenti meno recenti
Hi,
I am building a general block which needs and generates several signals.
The main idea is to connect one block to the next one, concatenating the output signal, but also decatenating the input (one of each per block).
Suppose two arrays, one of inputs (A) and one of outputs (B). So there will be two inputs (Ain, Bin) and two outputs (Aout, Bout), and they will be connected from one block to the next block.
_______ _______ _______
Ain ----| |----| |----| |----··· Aout (inputs vector)
| BLOCK | | BLOCK | | BLOCK |
Bin ----|_______|----|_______|----|_______|----··· Bout (outputs vector)
The signal the block needs will be always the first of A, and the output will be appended at the end of B. Written in code will be like this:
% Outputs (concatenate)
Bout = [B_generated Bin];
% Inputs (decatenate)
A_wanted = Ain(1);
Aout = Ain(2:end);
In Simulink there is the vector concatenate block which does the first part, but how to decatenate/discatenate the inputs? Is there a proper block?
I don't want to use a selector block because in this case I'll have to modify every block I append and change the input port size.
Thanks in advance!
Risposta accettata
Più risposte (1)
Guy Rouleau
il 3 Mag 2013
0 voti
Use the Selector block
1 Commento
Dani Tormo
il 6 Mag 2013
Modificato: Dani Tormo
il 7 Mag 2013
Categorie
Scopri di più su Sources in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!