%Minimalbeispiel Ticks
clear, close all
%Fußpunkte X - Achse
x=struct();
y=struct();
z1=struct();
z2=struct();
z={z1,z2};

%Die Achsenwerte sind passend zu den gelieferte Messwerten
x.norm = [0 5 10 25 50 100 200 300 400];
y.norm = [1000 800 600 400 300 250 200]';

%Die Werte z entsprechen den gelieferten Messwerten für vorerst 2,
%langfristig mehr Objektre, darum das cell - Array
for k=1:size(z,2)
    z{k}.norm=rand(size(y.norm,1), size(x.norm,2));
end

%Für flüssigere Darstellung interpolieren
for k=1:size(z,2)
    z{k}.interp = interp2(z{k}.norm,3);
end
%"Data dimensions must agree --> Auch Stützpunkte interpolieren

%für interp wird eine Matrix benötigt und nicht ein Array
for k=1:size(x.norm,2)
    x.mat(1,k) = x.norm(1,k);
    x.mat(2,k) = x.norm(1,k);
end
for k=1:size(y.norm,1)
    y.mat(k,1) = y.norm(k,1);
    y.mat(k,2) = y.norm(k,1);
end
%interpolieren
x.interp=interp2(x.mat,3);
y.interp=interp2(y.mat,3);
%wieder zurück in ein Array umwandeln
x.interp_plot(1,:)=x.interp(1,:);
y.interp_plot(:,1)=y.interp(:,1);

%Plots der einzelnen Objekte
 scrsz = get(0,'ScreenSize');
for k=1:size(z,2)
    figure('Position',[scrsz(3)*0.25 scrsz(4)*0.25 scrsz(3)*0.5 scrsz(4)*0.5])
    surf(x.interp_plot,y.interp_plot,z{k}.interp,'LineStyle','none')
    set(gca,'GridLineStyle','-')
    set(gca,'YDir','reverse')
    axis([10 400 200 800 -1 1])
    %                    Pos.x Posy Breite Höhe
    colorbar('Position',[0.95 0.1 0.01 0.8])
    colorbar('Position',[0.95 0.1 0.01 0.8])
    
end

