Hello Hasan,
Variable size arrays are always a bit tricky to deal with in Simulink. This documentation page addresses this issue directly, and points towards an example model that demonstrates how to do this kind of access.
-Cam
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!