function [ifig]=MotorPlot2(Vin,Iin,IinMat,PoutMat,ToutMat,RPMMat,etaMat,titstr,ifig)
%Plots motor properties as a fuction of input current
ifig=ifig+1; figure(ifig)

subplot(411)
plot(IinMat,etaMat)
%YI = INTERP1(X,Y,XI)
etaNominal=interp1(IinMat,etaMat,Iin);
hold on; plot(Iin,etaNominal,'r*'); hold off;
ylabel('motor efficiency')
text(10,.2,'* is the selected operating point')
string70=[titstr,' with ',num2str(Vin), ' volts input'];
title(string70)

subplot(412)
plot(IinMat,RPMMat)
RPMNominal=interp1(IinMat,RPMMat,Iin);
hold on; plot(Iin,RPMNominal,'r*'); hold off;
ylabel('RPM')

subplot(413)
plot(IinMat,PoutMat)
PoutNominal=interp1(IinMat,PoutMat,Iin);
hold on; plot(Iin,PoutNominal,'r*'); hold off;
ylabel('Power Out(watts)')

subplot(414)
plot(IinMat,ToutMat)
ToutNominal=interp1(IinMat,ToutMat,Iin);
hold on; plot(Iin,ToutNominal,'r*'); hold off;
xlabel('motor current (amperes)')
ylabel('Torque out(in-oz)')


subplot(411); 
subplot(412); 
subplot(413); 
subplot(414); 
