Effacer les filtres
Effacer les filtres

Can the variable selector block operate on variable-sized data?

2 vues (au cours des 30 derniers jours)
Joshua Ford
Joshua Ford le 8 Juin 2021
Réponse apportée : Pramil le 21 Fév 2024
I wish operate an fft on each column of a matrix. I am doing this by using a variable selctor block in a for iterator block. My data is classed as variable-sized (however does not change size). The variable selector block does not like variable-sized data. Is there a way around this?

Réponses (1)

Pramil le 21 Fév 2024
Yes, there is a way around this problem. Use a "For Each Subsystem" block, which allows you to apply the FFT block to each column of the matrix individually.
Double click on the "For Each Subsystem" block and place the “FFT” block in between the “inport” and the “outport” block.
Set the "Partition Dimension" to 2 to iterate over the second dimension (columns) of the input matrix. Set the "Partition Width" to 1 to process one column at a time.
You can check out this documentation for knowing more about the "For Each Subsystem" block :
I have attached a sample model for your reference.

Community Treasure Hunt

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

Start Hunting!

Translated by