% motor analysis 
%
%
clear
motordata
figure(10); clf
[nmotor,col]=size(mdata)
subplot(411)
plot(mdata(:,7),mdata(:,1),'o')
ylabel('Kv(RPM/V)')
xlabel('HP')
title(' The AstroFlight Cobalt Sport Motors for Model Aircraft')
[m,b,c]=curve(mdata(:,7)',mdata(:,1)')
L1=m*mdata(:,7)+b+c./mdata(:,7);
hold on; plot(mdata(:,7),L1); hold off


subplot(412)
plot(mdata(:,7),mdata(:,2),'o')
ylabel('Kt(in-oz/amp)')
xlabel('HP')
[m2,b2]=straightline(mdata(:,7)',mdata(:,2)')
L2=m2*mdata(:,7)+b2;
hold on; plot(mdata(:,7),L2); hold off


subplot(413)
plot(mdata(:,7),mdata(:,3),'o')
ylabel('R(ohms)')
xlabel('HP')
[m3,b3,c3]=curve(mdata(:,7)',mdata(:,3)')
L3=m3*mdata(:,7)+b3+c3./mdata(:,7);
hold on; plot(mdata(:,7),L3); hold off


subplot(414)
plot(mdata(:,7),mdata(:,4),'o')
ylabel('Io (amperes)')
xlabel('HP')
v=axis;
axis([v(1),v(2),0,v(4)])
[m4,b4,c4]=curve(mdata(:,7)',mdata(:,4)')
L4=m4*mdata(:,7)+b4+c4./mdata(:,7);
hold on; plot(mdata(:,7),L4); hold off
