%
%  idof_plot.m  ver 1.2  January 11, 2013
%
function[]=idof_plot(t,x,y,accel,num,iu)
%
    fig_num=1;
%
    if(iu==1)
        accel=accel/386;
    end
%
    while(1)
%       
        disp(' ');
        n=input(' Enter dof number for plotting ');
%        
        figure(fig_num);
        fig_num=fig_num+1;
        plot(t,x(:,n));        
        grid on;
        xlabel('Time(sec)');
        out1=sprintf('Displacement dof %d',n);
        title(out1);
        if(iu==1)
            ylabel('Disp(in)');
        else
            ylabel('Disp(m)');    
        end        
%
        figure(fig_num);
        fig_num=fig_num+1;
        plot(t,y(:,n));
        grid on;        
        xlabel('Time(sec)');
        out1=sprintf('Velocity dof %d',n);
        title(out1);
        if(iu==1)
            ylabel('Vel(in/sec)');
        else
            ylabel('Vel(m/sec)');    
        end
%
        figure(fig_num);
        fig_num=fig_num+1;
        plot(t,accel(:,n));
        xlabel('Time(sec)');
        out1=sprintf('Acceleration dof %d',n);
        title(out1);
        if(iu==1)
            ylabel('Accel(G)');
        else
            ylabel('Accel(m/sec^2)');    
        end
        grid on;
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
        disp(' ');
        disp(' Plot relative displacement? ');
        disp('  1=yes  2=no ');
        ird=input(' ');
%
        if(ird==1)
            disp(' ');
            n1=input(' Enter first dof number ');
            n2=input(' Enter second dof number ');
%   
            clear rd;
            rd=x(:,n1)-x(:,n2);
%
            figure(fig_num);
            plot(t,rd);
            xlabel('Time(sec)');
            out1=sprintf('Relative Displacement dof %d-%d',n1,n2);
            title(out1);
            if(iu==1)
                ylabel('Disp(in)');
            else
                ylabel('Disp(m)');    
            end
            grid on;
        end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
        disp(' ');
        disp(' Plot another dof?  1=yes 2=no ');
        ia=input(' ');
        if(ia==2)
            break;
        end
%
    end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%