Make a matrix with putting zeros between numbers in every rows
I want make a 4*P matrix from P numbers
P=p1+p2+p3+p4
X=[x11 ... x1p1 0...0 0...0 0...0 ; 0...0 x2p1+1 ... x2p2 0...0 0...0 ;
0...0 0...0 x3p2+1 ... x3p3 0...0 ; 0...0 0...0 0...0 x4p3+1 ... x4p4]
there are values in pi of P elements in every row and other elements of
row are zero for example input=[1,2,3,4,5,6,7,8,9] p1=1, p2=2, p3=3, p4=3
X=[1 0 0 0 0 0 0 0 0; 0 2 3 0 0 0 0 0 0; 0 0 0 4 5 6 0 0 0; 0 0 0 0 0 0 7
8 9]
thanks
No comments:
Post a Comment