Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Same as "changem" MATLAB function
- function mapout = my_changem(mapout, newcode, oldcode)
- assert(numel(newcode) == numel(oldcode), 'newcode and oldecode must have the same number of elements');
- [toreplace, bywhat] = ismember(mapout, oldcode);
- mapout(toreplace) = newcode(bywhat(toreplace));
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement