%===================================================
%
% Generate samples of the Ising MRF model
%
% Aleksandra Pizurica TELIN/RUG 1998.
%===================================================

Operation ='Create a sample of the Ising MRF model';
Alpha=input('Choose the label cost parameter Alpha\nAlpha=0 : equally probable labels -1 and 1; \nAlpha>0: preference for -1,  Alpha<0: preference for +1 (try ~ 0.05) ;\nAlpha=   ');
Beta=input('Choose the interaction parameter Beta\nBeta<0 labels of the same type cluster (try Beta=-0.9)\nBeta= ');
M=100;
N=100;
%M=input('Nr. rows=');
%N=input('Nr. cols.= ');
ITERA=40;
Temp=1;

GenerateOther='y'
while(GenerateOther=='y')
  X=Ising(Alpha,Beta,Temp,M,N,ITERA);
  imagesc(X);
  colormap(gray);
  GenerateOther=input('Generate another sample (y/n) ','s');
end