Write a script that will create the image seen in the Figure below using a colormap
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:13| Question number:2.13
All Answers
total answers (1)
Ch13Ex2.m
% Creates a four color image using a custom colormap
mycolormap = [1 0 0; 0 1 0; 0 0 1; 1 1 1];
colormap(mycolormap)
mat = ones(50);
mat(1:25,1:25) = 4;
mat(1:25, 26:50) = 2;
mat(26:50, 26:50) = 3;
image(mat)
need an explanation for this answer? contact us directly to get an explanation for this answer