Educational materials

Notes

  • Needs to be tested

% BigCopy = replicatePattern (A, N)
% Replicate into BigCopy the pattern from A, N times

if N < 0 
   disp 'Error: Value given for N was less than zero, ignoring replication'
   BigCopy = A;
   return
end

BigCopy = A

[initSizeX,initSizeY] = size(A);

% Check for double dimensions (should exit)


for j=1:N
  for k=1:initSizeX
     BigCopy(initSizeX*k+j) = A(j);
  end
end

% Tada, all done!

r1 - 21 Jul 2008 - 19:31:39 - AaronStriegel
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Syndicate this site RSSATOM