Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. for ii=1:10
  2. R1 = [1,2;3,4]; Matrix is always 2x2 but different values each iteration
  3. cov = blkdiag(R1);
  4. end
  5.  
  6. [ R1,0,0,0...,
  7. 0,R1,0,0...]
  8.  
  9. R1 = [1,2;3,4]; %// matrix to be copied
  10. CurrentOut = R1; %// output
  11. for ii = 1:10
  12. [A,B] = size(CurrentOut); %// get current size
  13. tmpout(A+2,B+2)=0; %// extend current size
  14. tmpout(1:A,1:B) = CurrentOut; %// copy current matrix
  15. tmpout(A+1:end,B+1:end) = R1; %// add additional element
  16. CurrentOut=tmpout; %// update original
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement