MATLAB Answers

0

SIMEVENT predefined attribute generation

Asked by luca ruozi on 9 Sep 2019 at 10:37
Latest activity Commented on by Renato SL on 9 Sep 2019 at 11:37
Hi given a matrix A
A = [1 2 7 5 6 6 7 8 5 3 4 2 1 3 5 6; 1 6 1 1 1 2 7 9 5 3 2 2 3 3 4 6; 3 1 3 6 8 2 7 9 5 3 4 2 2 5 5 6]
I want to generate 3 different simulation where the entitities at each simulation acquire the attribute given by each row. So the in the first simulation the entities should acquire attribute values equal to the first raw: the first entity generated must have attibute=1, the second entity generated must have attribute=2, the third entity generated must have attribute = 7, the fourth entity generated must have attribute= 5 and so on...
Does someone know how can I obtain this in SIMEVENT, starting from a predefined matrix in matlab ?

  1 Comment

Renato SL on 9 Sep 2019 at 11:37
I have tried something with an example that I'm working on.
I put a vector of values defined in the workspace as the Vector of output values of a Repeating Sequence Stair block. Then, the output of the block is connected to a Simulink function (say, assign_attribute() ). Then inside the Entity Generator, I set the entities to have the attribute attr1, and in the Event Actions tab -> Generate, I put entity.attr1 = assign_attribute().
Maybe Repeating Sequence Stair is not the right block for what you want, but I think the overall method should be similar.

Sign in to comment.

0 Answers