Advertisement
celestialgod

3D matrix copy

Jan 4th, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.14 KB | None | 0 0
  1. HSV = randn(10, 10, 3);
  2. light = zeros(size(HSV));
  3. copyIndex = repmat(HSV(:, :, 1) > 0, 1, 1, size(HSV, 3));
  4. light(copyIndex) = HSV(copyIndex);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement