Hi, I made a custom colormap (size = 15 x 3) and now I am trying to use it but it is not working. Here is the code:
And then I get this error:
Undefined function or variable 'mycmap'.
The mycmap variable is loaded into my workspace. Any help is appreciated.
No products are associated with this question.
executed in the base workspace?
You can try using the colormap() function instead. Does this work for you?
grayImage = imread('cameraman.tif'); image(grayImage); mycmap = jet(15); % set(gcf,'Colormap',mycmap) colormap(mycmap); colorbar
Apparently you did not specify mycmap like you thought. Put this line right before your call to set():
If it says it's undefined, then it is undefined, not 15 by 3 like you thought.
Play games and win prizes!Learn more