Looping and manipulating structure in Simulink
Show older comments
I have the following query:
There is a structure X having say 'n' columns (n is a variable) and each of the columns represents some data with a sampling time of 0.001 second. However, the length of the data in each of the columns is required to be different. Say for example in column 1 there are 100 entries, in column 2 there are 70 entries and column 3 there are 40 entries. The requirement is to select any one of the columns depending on the 'index' which specifies the column number. After selecting this column, the number of elements for this column are to be selected and cyclically repeated. Repetition of each data set (one column) will require different times since their lengths are different.
The problem I am facing that selecting a particular column is possible but truncating it to the required length and then cyclically repeating it doesn't look possible. I am using the cyclic repetition option for output data from the 'simin' block. This requires the lengths of all the columns to be the same. Hence I am padding the remaining data in smaller columns with zeros. However while repeating this there seems no way for specifying that data is to be repeated only for certain length.
Any suggestions are welcome. Thanks.
Answers (0)
Categories
Find more on Sources in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!