Thread Subject: Concatenation in Simulink

Subject: Concatenation in Simulink

From: Paburo

Date: 3 Sep, 2010 01:24:04

Message: 1 of 3

Hi,

Two constant arrays 2x2 were defined using Source Blocks in Simulink.
They were concatenated (e.g. horizontally).
Result was assigned to the variable zz using 'To Workspace' block.

If the 'To Workspace' block parameter 'Limit data points to last' is equal to 1 than zz is 2x4 matrix.
If 'Limit data points to last' is the default inf or 2 than zz is 2x4x2 matrix, two identical 2x4 matrices in two planes.

Why is 2x4x2 matrix in the latter case?

Regards,

Pavel

Subject: Concatenation in Simulink

From: Phil Goddard

Date: 3 Sep, 2010 04:25:26

Message: 2 of 3


The 3rd dimension says at how many time points the signal has been saved.

So for 'Limit data points to last' equal to 1 the output is 2x4x1, but since the 3rd dimension is a singleton it isn't used and the result if 2x4.

For 'Limit data points to last' equal to 2 the output is 2x4x2, which is one 2x4 matrix at each of the last 2 time points.

For 'Limit data points to last' equal to inf the output is 2x4xn, where n is the number of time steps that the simulation takes, which is one 2x4 matrix at each of the simulation time points.

Phil.

Subject: Concatenation in Simulink

From: Paburo

Date: 4 Sep, 2010 16:52:03

Message: 3 of 3

Thank you Phil,

Should I suggest that in the case of a simple model like 'source-concat-sink' Simulink produces two points, start and stop. This is why there was always 2 in the last dimension, if 'Limit data points to last' was greater than 1.


"Phil Goddard" <philNOSPAM@goddardconsulting.ca> wrote in message <i5ptbm$208$1@fred.mathworks.com>...
>
> The 3rd dimension says at how many time points the signal has been saved.
>
> So for 'Limit data points to last' equal to 1 the output is 2x4x1, but since the 3rd dimension is a singleton it isn't used and the result if 2x4.
>
> For 'Limit data points to last' equal to 2 the output is 2x4x2, which is one 2x4 matrix at each of the last 2 time points.
>
> For 'Limit data points to last' equal to inf the output is 2x4xn, where n is the number of time steps that the simulation takes, which is one 2x4 matrix at each of the simulation time points.
>
> Phil.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com