Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ii=1:10
- R1 = [1,2;3,4]; Matrix is always 2x2 but different values each iteration
- cov = blkdiag(R1);
- end
- [ R1,0,0,0...,
- 0,R1,0,0...]
- R1 = [1,2;3,4]; %// matrix to be copied
- CurrentOut = R1; %// output
- for ii = 1:10
- [A,B] = size(CurrentOut); %// get current size
- tmpout(A+2,B+2)=0; %// extend current size
- tmpout(1:A,1:B) = CurrentOut; %// copy current matrix
- tmpout(A+1:end,B+1:end) = R1; %// add additional element
- CurrentOut=tmpout; %// update original
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement