clc clear %a) load m44.dat A = m44(:); %zvektorizuje maticu mesh(m44) %vykresli trojrozmerny graf %b) priemer = mean(A) %aritmeticky priemer med = median(A) %median modus = mode(A) %modus n = size(A,1); %urci pocet prvkov matice sigma = sqrt(sum((A-mean(A)).^2)/(n-1.46)) %standardna odchylka, inak std() gamma1 = sum((A-mean(A)).^3)/n/sigma^3 %sikmost, inak skewness() gamma2 = (n+1)/(n-1)*sum((A-mean(A)).^4)/n/sigma^4-3 %spicatost, inak kurtosis() sikmost = skewness(A) spicatost = kurtosis(A) %c) sigma_r = 1.482*median(abs(A-median(A))) %robustna odchylka stars = find(abs(m44-median(A))>3.5*sigma_r); %vrati vektor suradnic matice m44, v ktorych su odlahle body - hviezdy noise = m44; noise(stars) = []; %odstrani prvky matice noise, kde sa nachadzaju hviezdy A = noise; priemer = mean(A) med = median(A) modus = mode(A) sigma = sqrt(sum((A-mean(A)).^2)/(n-1.46)) gamma1 = sum((A-mean(A)).^3)/n/sigma^3 gamma2 = (n+1)/(n-1)*sum((A-mean(A)).^4)/n/sigma^4-3