Hello everyone, I'm having trouble with my script. First off, this is the relevant code:
rawData = importdata('part1.csv', ';', 1);data = rawData.data;zeilen = size(data,1);for i = 1:zeilenLHuef=[data(i,3);data(i,4);data(i,5)];RHuef=[data(i,6);data(i,7);data(i,8)];MHuef=[data(i,9);data(i,10);data(i,11)];LKnie=[data(i,12);data(i,13);data(i,14)];RKnie=[data(i,18);data(i,19);data(i,20)];ORueck=[data(i,30);data(i,31);data(i,32)];LHuef1=[LHuef(2);LHuef(3)];LKnie1=[LKnie(2);LKnie(3)];ORueck1=[ORueck(2);ORueck(3)];MHuef1=[MHuef(2);MHuef(3)];RHuef1=[RHuef(2);RHuef(3)];RKnie1=[RKnie(2);RKnie(3)];HKL = (LHuef1 - LKnie1);HR = (ORueck1 - MHuef1); HKR = (RHuef1 - RKnie1);dalphaL = acosd(abs(dot(HKL,HR))/(norm(HKL)*norm(HR)));
I'm getting this error:
Subscript indices must either be real positive integers or logicals. Error in ExcelVariante (line 62) dalphaL = acosd(abs(dot(HKL,HR))/(norm(HKL)*norm(HR)));
I tested a bit and found that "norm" doesn't seem to be working correctly here. The data is just x-y-z-coordinates, I set these vectors and calculate a lot of stuff with it. Including said angle-calculation which gives me back an error. If I set my vectors HKL, HR and HKR to fixed values it works. I have no clue why it does not work with my data matrix though.
If necessary I can provide more code, but I could not find anymore code relevant for the line causing my error.
Thanks in advance everyone.
Best Answer