Colormap Question for script requirements? - Homework
Ältere Kommentare anzeigen
I am trying to make two colormaps. Both will be using white and black colors only. It is a 50 x 50 matrix image where each element is randomly either white or black. However, the second image has the colors reversed (so all white is black and vice versa). This is my script I have.
subplot(1,2,1);
cm = [0 0 0;1 1 1];
colormap(cm);
mat = randi(2,50);
image(mat);
title('Yin');
subplot(1,2,2);
cm2 = [1 1 1;0 0 0];
colormap(cm2);
image(mat);
title('Yang');
The only problem is that I don't know where to have the second image switch colors from the first image???
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Color and Styling finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!