No BSD License  

Highlights from
Calculating blending moment of the shaft

image thumbnail
from Calculating blending moment of the shaft by Riccardo
It calculate blending moment of the shaft when you insert a generic number of forces.

torx
function torx
torcente=evalin('base','torcente');
lung=evalin('base','lunghezza');
vect=evalin('base','Vettori');
nFor=evalin('base','numeroforze');

for i=1:nFor+1
    torc1=line([vect(i,3) vect(i+1,3)], [torcente(i) torcente(i)],'marker','.','Color','g');
    text(vect(i,3),torcente(i),[num2str(torcente(i)),'Nm']);
end
for i=1:nFor+2
    if i==nFor+2
        torc2=line([vect(i,3) vect(i,3)], [0 torcente(i-1)],'marker','.','Color','g');        
    else
        torc3=line([vect(i,3) vect(i,3)], [0 torcente(i)],'marker','.','Color','g');
    end
    if i~=1
        torc4=line([vect(i,3) vect(i,3)], [0 torcente(i-1)],'marker','.','Color','g');
    end
end
text(vect(1,3),torcente(1),[num2str(torcente(1)),'Nm']);
ylabel('Momento Torcente in Nm'); xlabel('Lunghezza dell''albero in mm');
minMT=min(torcente)*1.3; maxMT=max(torcente)*1.3;
if maxMT==0
    maxMT=-minMT;
elseif minMT==0
    minMT=-maxMT;
end
axis ([-lung/10 1.1*lung minMT maxMT]);

Contact us at files@mathworks.com