function [ adjMat, D2 ] = prob_8_4( theta ) % % Written by: % -- % John L. Weatherwax 2005-08-14 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- data = [ 1 5; 2 5; 3 4; 6 4; 7 4; 8 5; ]; %fh=figure; plot( data(:,1), data(:,2), 'ok' ); axis( [ 0 9 3 6 ] ); grid on; % Value of theta: %theta = 2; D2 = sqrt( dist2( data, data ) ); adjMat = ( D2 < theta ); N = size(data,1); labels = cellstr(int2str((1:N)')); figure; draw_graph( double(adjMat), labels, ... zeros(1,size(data,1)), data(:,1), data(:,2) ); %figure; draw_graph( double(adjMat) );