% Delivered to the U.S. Government in Accordance with Contract FA8650-10-C-7080.
% 
%
% (c) 2011 United Technologies Corp.
% Developed with the sponsorship of the Defense Advanced Research Projects Agency (DARPA).
% Permission is hereby granted, free of charge, to any person obtaining a copy of this data,
% including any software or models in source or binary form, as well as any drawings, 
% specifications, and documentation (collectively "the Data"), to deal in the Data without 
% restriction, including without limitation the rights to use, copy, modify, merge, publish,
% distribute, sublicense, and/or sell copies of the Data, and to permit persons to whom the Data
% is furnished to do so, subject to the following conditions:
%  
% The above copyright notice and this permission notice shall be included in all copies or
% substantial portions of the Data.
%  
% THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
% BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, SPONSORS, DEVELOPERS, CONTRIBUTORS, OR
% COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
% OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DATA OR THE
% USE OR OTHER DEALINGS IN THE DATA.

% Authors:  Fernando Rodriguez                      John Finn
%           Sr Engineer/Scientist                   Contractor
%           Power Electronics Systems               Embedded Systems & Networks
%           United Technologies Research Center     United Technologies Research Center
%           411 Silver Lane                         411 Silver Lane
%           East Hartford,CT 06108                  East Hartford,CT 06108
%           rodrigf@utrc.utc.com                    ccfinnje@utrc.utc.com
%           tel: (860) 610-7102                     tel: +1 860-610-7696
%%

function plot_data(nl, B_No)

    x = load('output.mat');
    figure (1)
    plot(x.ans.Time,x.ans.Data(:,1))
    title('Input')
    grid on

    figure (2)
    if nl < 18
        k = nl;
    else 
        k = 18;
    end
    for i = 1 : k
        subplot(6,3,i)
        plot(x.ans.Time,x.ans.Data(:,i+1))
        title(strcat('Load Current::',num2str(i)))
        grid on
    end
    if nl > 18
        figure (3)
        for i = 19 : nl
            subplot(6,3,i-18)
            plot(x.ans.Time,x.ans.Data(:,i+1))
            title(strcat('Load Current::',num2str(i)))
            grid on
        end 
    end
    nv = length(x.ans.Data(1,1+nl+1:end));
    figure
    for i = 1 : nv
        if i <= length(B_No)
            subplot(3,4,i)
            plot(x.ans.Time,x.ans.Data(:,i+1+nl))
            title(strcat('Voltage::',num2str(B_No(i))))
            grid on
        else
            subplot(3,4,i)
            plot(x.ans.Time,x.ans.Data(:,i+1+nl))
            title(strcat('Voltage::',num2str(i - length(B_No))))
            grid on
        end  
    end