a) get rid of all the unnecessary brackets that make it harder to read your expressions
x = [indexbase(1,1), indexknuckle1(1,1), indexknuckle2(1,3)]
y = [indexbase(1,2), indexknuckle1(1,2), indexknuckle2(1,2)]
z = [indexbase(1,3), indexknuckle1(1,3), indexknuckle2(1,3)]
b) if you're using vectors, then use 1D notation instead of 2D notations, particularly if you're not careful about whether your vectors are row or column vectors:
x = [indexbase(1), indexknuckle1(1), indexknuckle2(3)]
y = [indexbase(2), indexknuckle1(1), indexknuckle2(2)]
z = [indexbase(3), indexknuckle1(3), indexknuckle2(3)]
This will fix your problem.
The cause for the error, is that indexknuckle1(1,2) asks for row 1 column 2 of vectors that have 3 rows and only one column. indexknuckle1(2,1) was meant here, but if you use 1D indexing it works regardless.
Best Answer