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

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?

Answers (1)

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.

Asked:

on 8 Jun 2021

Answered:

on 21 Feb 2024

Community Treasure Hunt

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

Start Hunting!