Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. % Same as "changem" MATLAB function
  2. function mapout = my_changem(mapout, newcode, oldcode)
  3. assert(numel(newcode) == numel(oldcode), 'newcode and oldecode must have the same number of elements');
  4. [toreplace, bywhat] = ismember(mapout, oldcode);
  5. mapout(toreplace) = newcode(bywhat(toreplace));
  6. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement