- #26

- 3

- 0

I have similar question, but with additional problem. I will appreciate if somebody can help me.

I want to creat block diagonal matrix (blocks 3x3, different), but the data for it saved as a 4D vector:

data = data(1:N,1:M,1:3,1:3)

I want to create main diagonal from

**data(2,1:M,1:3,1:3)**.

I mean M1 = data(2,1,1:3,1:3), M2 = data(2,2,1:3,1:3) and so on...

Thank you in advance.