Created
November 26, 2018 01:18
-
-
Save mattgaidica/f9f3d88dd4ae7d0143b963f96c2e06c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function colors = mycmap(filename,varargin) | |
% read image | |
A = imread(filename); | |
% set number of elements to return | |
n = size(A,2); | |
if ~isempty(varargin) | |
n = varargin{1}; | |
end | |
% create colors (cmap) | |
colors = double(squeeze(imresize(A,[1,n]))) ./ 255; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment