I need to make a code that will take a 1×19 vector of numbers (number of teeth on the gears available) then divide every number within the vector by one another to create a new 19×19 matrix, then multiply every number from that matrix by one another to create a new matrix. From this new matrix I must identify every solution that is over 16. I have figured all of that out. Except now I somehow have to figure out which combination of four original numbers got me a solution greater than 16. Here is what I have.How would I figure out which values from the gearteeth vector give me a solution greater than sixteen using when they are put through the following formula (a/b)*(c/d).
GearTeeth=[96,80,72,64,56,52,48,44,42,34,32,30,24,22,20,20,18,16,12];n=length(GearTeeth);for i=1:n for j=1:n TorqueRatio(i,j)=GearTeeth(i)/GearTeeth(j); j=j+1; endendm=1;for k=1:361 for l=1:361 GearRatio(k,l)=TorqueRatio(k)*TorqueRatio(l); if GearRatio(k,l)>16 A(m)=(GearRatio(k,l)); m=m+1; end l=l+1; endend
Best Answer