%1. uloha
load eclipse.txt
x = eclipse(:,1)+((eclipse(:,2)-1)/12);    %cas v rokoch
plot(x, eclipse(:,3),'*')
xlabel('cas [rok]')
ylim([0,4])    %ohranici y-ovu os od 0 do 4
set(gca, 'Ytick', 1:3, 'YtickLabel', {'čiastocné' 'polotienové' 'úplné'})...
    ...%definuje polohu menoviek

%2 uloha
load sunspot.txt
figure
plot(sunspot(:,3),sunspot(:,4),'*')
xlabel('cas [rok]')
ylabel('W')

%3. uloha
[logg,temperature,Z,turbulence,u,filter,method,program] = textread('vizier.dat',...
    '%f %u %f %f %f %s %s %s'); %vytvorili sme vektory 'logg' az 'program',...
    ...ktore maju typ float(f), integer(u) alebo string(s)
A = [];
for i = 1:size(filter,1)
    if strcmp(filter(i),'U')    %'strcmp' porovnava identickost stringov
        A = [A;logg(i),temperature(i),Z(i),turbulence(i),u(i),1];
    elseif strcmp(filter(i),'B')
        A = [A;logg(i),temperature(i),Z(i),turbulence(i),u(i),2];
    elseif strcmp(filter(i),'V')
        A = [A;logg(i),temperature(i),Z(i),turbulence(i),u(i),3];
    end
end
figure
scatter(A(:,2),A(:,5),2,A(:,6))
xlabel('teplota [K]')
ylabel('u')
colormap(jet(3))    %priradi cislam 1, 2 a 3 farebnu mapu 'jet'
hcb = colorbar('YTickLabel',{'U','V','B'},'location','EastOutside');
    %vytvori 'colorbar' s urcenymi menovkami a poziciou
set(hcb,'YTick',1.33:0.66:3)    %definuje polohu menoviek