clc
clear
load RLoutput;

time = outputdata3(1,:);
Voltage = outputdata3(2,:);
Current = outputdata3(3,:);

number = length(time)

subplot(2,1,1)
plot(time,Voltage,'k-');
axis([0 10 0 120]);
grid on;
xlabel('Time (seconds)');
ylabel('Voltage (Volts)');
title('Voltage vs. Time','FontSize',12);

subplot(2,1,2)
plot(time,Current,'k-');
axis([0 10 0 25]);
grid on;
xlabel('Time (seconds)');
ylabel('Current (Ampere)');
title('Current vs. Time','FontSize',12)

OPF = fopen('file1.dat','w');

for n=1:number
 fprintf(OPF,'%5.3f  %5.3f \n',time(n), Current(n));
end;

fclose(OPF);