I'm working on a script for four-bar linkages and need to remove the shortest and longest links for calculations. However if my shortest or longest value is repeated in my vector, my indexing removes all of them. How do I prevent all being removed when I just need 1 min and 1 max removed
l1 = 20;
l2 = 10;
l3 = 10;
l4 = 10;
a1 = [l1,l2,l3,l4];
L = 4;
J = 4;
G = 1;
M = 3*L-2*J-3*G
S=min(a1);
L=max(a1);
a2=a1(a1~=S & a1~=L);
P=a2(1); Q=a2(2);
0 Comments
Sign in to comment.