Skip to main content
4-Participant
September 16, 2016
Solved

Special Insertion of Multiple Vectors into One Vector

  • September 16, 2016
  • 4 replies
  • 2243 views

I'm thinking I need for loops to insert vectors P, M and V into Q as follows:

P0 into Q0

P1 into Q3

P2 into Q6

P3 into Q9

M0 into Q1

M1 into Q4

M2 into Q7

M3 into Q10

V0 into Q2

V1 into Q5

V2 into Q8

V3 into Q11

I need help with the programming and sequencing.

Best answer by MJG

In both examples, you can simply change the definition of k from "0...3" to "0...last(P)"

4 replies

1-Visitor
September 16, 2016

How about this?

No programming needed.

1-Visitor
September 16, 2016

If you want to do it programmatically, you could go this way:

hriek4-ParticipantAuthor
4-Participant
September 16, 2016

What about for an arbitrary sizes of vectors P, M, V? (these vectors will always be the same size)

MJG1-VisitorAnswer
1-Visitor
September 16, 2016

In both examples, you can simply change the definition of k from "0...3" to "0...last(P)"