Q:

Given the following colormap matrix:

0

mycmap = [1 1 1; 1 0 0; 0 1 0; 0 0 1; 1 1 0]; Write code that will generate the following 4x4 “image” matrix, using the colormap method:

Note: the axes are the defaults, and you only need 3 lines of code to accomplish this. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

colormap(mycmap)

immat = diag(1:4) + 1;

image(immat)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now