%-------------------------------------------------------------------------
%Plot über Zeit für Parameterstudie 2 Massenschwinger
%Dominik Marquardt/ TI-F/ 15.11.2010
%Stand: zwei/drei Radmassen werden Simuliert
%-------------------------------------------------------------------------
for x=1:1   % % 3mal wird der Plotfile durchlaufen einmal für jede Anregung

    %     %Funktion zur Entscheidung welche Ergebnismatrix geladen wird
    %     if z==6
    [s_ca,s_auf,s_rad,s_er,a_auf,a_rad,f_ca,f_ka,F_N,v_er,leg,sww,tm,TS]=erg_matrix_2(x);
    %     elseif z==9
    %[s_ca,s_auf,s_rad,s_er,a_auf,a_rad,f_ca,f_ka,F_N,v_er,leg,sww,tm,TS]=erg_matrix_3(x);
    %     end
    if x==1
        b=0;            %Anfangswert für fortlaufende nummerierung der Figures
    end

    if x==2
        b=7;            %Anfangswert für fortlaufende nummerierung der Figures
    end

    if x==3
        b=14;            %Anfangswert für fortlaufende nummerierung der Figures
    end
    for a=1:1       %vorher 1: 7

        %---------------------PLOT-FIGURES-----------------------------------------

        if 0<=a<=6
            b = b+1;figure(b);
            cx(1)=Subplot(2,1,1);
            plot(tm, s_er,'b-');
        end
        cx(2)=Subplot(2,1,2);
        legend('Bodenanregung');
        linkaxes(cx,'x');           %Ermöglicht synchrones zoomen der Subplots

        if a==1
            %AUFBAUBESCHL. ZU ANREGUNG
            plot(tm, a_auf);
            title('AUFBAUBESCHLEUNIGUNG','Fontsize',18);
            legend(leg);
%         elseif a==2
%             %RADAUFSTANDSKRAFT ZU ANREGUNG
%             plot(tm, F_N);
%             title('RADAUFSTANDSRKRAFT','Fontsize',18);
%             legend(leg);
%         elseif a==3
%             %FEDERKRAFT ZU ANREGUNG
%             plot(tm, f_ca);
%             title('FEDERKRAFT','Fontsize',18);
%             legend(leg);
%         elseif a==4
%             % WEG Aufbau ZU ANREGUNG
%             plot(tm, s_auf);
%             title('WEG Aufbau','Fontsize',18);
%             legend(leg);
%         elseif a==5
%             % WEG RAD ZU ANREGUNG
%             plot(tm, s_rad);
%             title('WEG RAD','Fontsize',18);
%             legend(leg);
%         elseif a==6
%             %RADBESCHL. ZU ANREGUNG
%             plot(tm, a_rad);
%             title('RADBESCHLEUNIGUNG','Fontsize',18);
%             legend(leg);
        end
%         if a==7
%             %DÄMPFERKRAFT ZU Geschwindigkeit
%             figure(b);
%             cx(1)=Subplot(2,1,1);
%             plot(tm, v_er,'b-');
% 
%             cx(2)=Subplot(2,1,2);
%             legend('Bodenanregung');
%             linkaxes(cx,'x');
%             plot(tm, f_ka );
%             title('DÄMPFERKRAFT','Fontsize',18);    % Untertitel
%             legend(leg);
%         end

        %----------------------------------------------------------------------
        %-----------------ATTRIBUTE FÜR PLOTS---------------------------------
        if x==1
            basistitel = ('Variation Radmasse Sweep');%bilde HAUPTTITEL

        elseif x==2
            basistitel= ('Variation Radmasse StepUp');%bilde HAUPTTITEL

        elseif x==3
            basistitel = ('Variation Radmasse FB');%bilde HAUPTTITEL
        end

        %set(figure(b),'Position', [0,0, 1280, 1024]); %figure auf Screen size


        Subplot(211);
        hold on;box on;grid on;
        set(gca,'Fontsize',16);
        xlabel(gca,'Time[s]','FontSize',16);
        if (0<a<=6)
            title({basistitel,'Bodenanregung'},'Fontsize',18);
            ylabel(gca,'s[m]','FontSize',16);
            legend('Bodenanregung');%bilde Titel
        end
        if a==7
            title({basistitel,'Geschwindigkeit'},'Fontsize',18);
            ylabel(gca,'V[m/s]','FontSize',16);
            legend('Geschwindigkeit');
        end

        Subplot(212);
        hold on;box on;grid on;
        set(gca,'Fontsize',16);
        xlabel(gca,'Time[s]','FontSize',16);
        if (a==4) || (a==5)
            ylabel(gca,'s[m]','FontSize',16);
        elseif (a==6) || (a==1)
            ylabel(gca,'a[m/s^2]','FontSize',16);
        elseif (a==3) || (a==7) || (a==2)
            ylabel(gca,'[N]','FontSize',16);
        end
        if (x==2)
            axis([0.5 3.5  -inf inf]);
        elseif (x==3)
            axis([0 20 -inf inf]);
        else
            axis([0 20 -inf inf]);
        end
    end
    
    %save_plots_zeit;       % Files zum Speichern der Plots aufrufen
    %clear all;clc;clf;close all;
    
end

















