%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Siddhartha Kasivajhula % PSYCH 221/ EE 362 (Winter 2007-2008) % Final Project: A Probabilistic Model of the Visual System % % GenerateInitialScene.m % Generates features in the initial scene randomly % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function scene = GenerateInitialScene(NUM_FEATURES, NUM_SCENE_FEATURES) % the size of the feature space -- use 10 N = NUM_FEATURES; N_f = NUM_SCENE_FEATURES; % uniquely represent all possible features as vectors all_features = eye(NUM_FEATURES); %scene_features = [1 2 4 5 8 10]; % define the scene: pick N_f random features from the full feature space of possible features scene_features = zeros(1, N_f); for i=1:N_f scene_features(i) = ceil(N * random('uniform', 0, 1)); end %disp('The initial scene feature numbers are:'); %disp(scene_features); scene = GenerateScene(N, scene_features);