0
votes

I am trying to have simple functionality using a 2D vector [M x N]. My intention is to iterate the rows and read the columns. So, I use a FOR iterator subsystem, set the FOR iterator from 0 -> M-1 and then perform some operations on the read data.

For the sake of simplicity in the example below, I have used the only a vector of size 1X10 : [100 200 300 400 500 600 700 800 900 1000]

example

However, the for iterator does not show any change of value ( both iterator and the read column ). I put scope and I see only last value i.e. 900 of the vector.

inside the for iterator subsystem

Scope on the output of subsystem>

Scope on the output of for subsytem

Scope on the for iterator block>

Scope on for iterator block

Block parameters of FOR iterator:

FOR ITERATOR parameters

Parameters of SELECTOR block:

SELECTOR block parameters The sample time is set to -1.

Expected output: My expectation is that I read a column for each indexes and thus the scope on subsystem output should linear change, 100 -> 200 -> 300 -> 400 .......-> 1000. What am I doing wrong here?

Thank you!

1

1 Answers

1
votes

What you see is intended behavior, you always see the state at the end of the block execution. Your primary option is to create a vector using an assignment block. This way the vector holds one value for each iteration.