%create a 2-D array of 20 rows and 20 columns, and mimic tumor patterns.
clear;  %clear variables in the workspace
clc;   %clear the plotting window

tum(20,20)=0;  %initiate the tumor variable
tum(1,5)=1;    %define a noise feature 
tum(8,5)=1;    %define another noise featuer
tum(3,3)=1;    %define a benign tumor
tum(3,4)=1;    
tum(7,9)=1;    %define a begin tumor
tum(8,9)=1;
tum(6,2)=1;   %define a malignant tumor (left bend)
tum(6,3)=1;   
tum(7,2)=1;
tum(4,7)=1;   %define another malignant tumor (right bend)
tum(4,8)=1;   
tum(5,8)=1;
tum(1,15)=1;    %define a noise feature 
tum(8,15)=1;    %define another noise featuer
tum(3,13)=1;    %define a benign tumor
tum(3,14)=1;    
tum(7,19)=1;    %define a begin tumor
tum(8,19)=1;
tum(6,12)=1;   %define a malignant tumor (left bend)
tum(6,13)=1;   
tum(7,12)=1;
tum(4,17)=1;   %define another malignant tumor (right bend)
tum(4,18)=1;   
tum(5,18)=1;
tum(11,5)=1;    %define a noise feature 
tum(18,5)=1;    %define another noise featuer
tum(13,3)=1;    %define a benign tumor
tum(13,4)=1;    
tum(17,9)=1;    %define a begin tumor
tum(18,9)=1;
tum(16,2)=1;   %define a malignant tumor (left bend)
tum(16,3)=1;   
tum(17,2)=1;
tum(14,7)=1;   %define another malignant tumor (right bend)
tum(14,8)=1;   
tum(15,8)=1;


dlmwrite('tumor1.txt',tum,' ')  %write the data to an external data file

%tum1=dlmread('tumor1.txt')   %read the data from an external data file

mycolormap=[1,1,1;0,0,0]   %define a color map
colormap(mycolormap)       %call my color map
imagesc(tum)               %show the image of the 2-D data
axis square                %square axis
grid on                    %show data grid
set(gca,'XTick',[1:20],'YTick',[1:20])