%
%  mdof_plot_rod.m  ver 1.1  December 27, 2011
%
function[]=mdof_plot_rod(t,x,y,accel,num,iu)
%
    [colororder,color_rows]=line_colors();
%
    fig_num=1;
    figure(fig_num);
    fig_num=fig_num+1;
    hold('all');
%
    j=1;
    for i = 1:num
        if(j>color_rows)
            j=j-color_rows;
        end
        plot(t,x(:,i),'Color', colororder(j,:));
        j=j+1;
    end
    hold off;
    grid on;
    xlabel('Time(sec)');
    title('Displacement');
    if(iu==1)
        ylabel('Disp(in)');
    else
        ylabel('Disp(m)');    
    end
    plot_legend(num);
    hold off;
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
    figure(fig_num);
    fig_num=fig_num+1;
%    
    hold('all');
%
    j=1;
    for i = 1:num
        if(j>color_rows)
            j=j-color_rows;
        end
        plot(t,y(:,i),'Color', colororder(j,:));
        j=j+1;
    end
    hold off;
    grid on;
    xlabel('Time(sec)');
    title('Velocity');
    if(iu==1)
        ylabel('Vel(in/sec)');
    else
        ylabel('Vel(m/sec)');    
    end
    plot_legend(num);
%
    hold off;
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
    figure(fig_num);
    fig_num=fig_num+1;
    N=length(t);
%
    if(iu==1)
        accel=accel/386;
    end
%
%%
    hold('all');
%
    j=1;
    for i = 1:num
        if(j>color_rows)
            j=j-color_rows;
        end
        plot(t,accel(:,i),'Color', colororder(j,:));
        j=j+1;
    end
    hold off;
%%
    xlabel('Time(sec)');
    title('Acceleration');
    if(iu==1)
        ylabel('Accel(G)');
    else
        ylabel('Accel(m/sec^2)');    
    end
    grid on;
    plot_legend(num);
    hold off;
%
    disp(' ');
%%    n1=input(' Enter first dof number ');
%%    n2=input(' Enter second dof number ');
%
    n1=1;
    n2=num;
%   
    clear rd;
    rd=x(:,n1)-x(:,n2);
%
    figure(fig_num);
    plot(t,rd);
    xlabel('Time(sec)');
    out1=sprintf('Relative Displacement, Free End - Base ');
    title(out1);
    if(iu==1)
        ylabel('Disp(in)');
    else
        ylabel('Disp(m)');    
    end
    grid on;
%    
    fig_num=fig_num+1;   
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
    disp(' ');
    disp(' Absolute Acceleration, Free End ');
    disp(' ');
%
    if(iu==1)
        out1=sprintf('  max = %8.4g G',max(accel(:,num)));
        out2=sprintf('  min = %8.4g G',min(accel(:,num)));            
    else
        out1=sprintf('  max = %8.4g m/sec^2',max(accel(:,num)));
        out2=sprintf('  min = %8.4g m/sec^2',min(accel(:,num)));   
    end    
%
    disp(out1);
    disp(out2);  
%
    disp(' ');
    disp(' Relative Displacement, Free End - Base ');
    disp(' ');
%
    if(iu==1)
        out1=sprintf('  max = %8.4g inch',max(rd));
        out2=sprintf('  min = %8.4g inch',min(rd));            
    else
        out1=sprintf('  max = %8.4g m',max(rd));
        out2=sprintf('  min = %8.4g m',min(rd));   
    end    
%
    disp(out1);
    disp(out2);  
%