%% Exercise Sheet 12, Ex. 4. a): % (Gaussian Markov random field) % names of the states (to identify which number belongs to which state) names = {'Schleswig-Holstein', 'Mecklenburg-Vorpommern', 'Bremen', ... 'Hamburg', 'Brandenburg', 'Berlin', 'Niedersachsen', ... 'Sachsen-Anhalt', 'Sachsen', 'Nordrhein-Westfalen', 'Hessen', ... 'Thüringen', 'Rheinland-Pfalz', 'Saarland', ... 'Baden-Württemberg', 'Bayern'}; % average rainfall in the states mu = [62; 51; 57; 64; 50; 50; 57; 52; 66; 59; 65; 64; 69; 87; 84; 76]; % the adjacency matrix (1 if there is an edge between two states, % 0 otherwise A = dlmread('adjacency_matrix.txt'); % reads the boundaries of the states boundaries = {}; for i=1:length(names) boundaries{i} = dlmread(char(strcat(names(i), '.txt'))); end %% % HERE goes your code ... %% % plots the vector X of simulated rainfall into a map of Germany figure(1); plotResult(boundaries, X);