It is beyond me why I cannot figure this out. The debugger points to the line 'wsstd(i,1) = fricvelo.*4;' but I think it has to do with my if statement as even when the condition is failed, a calculation is still done. L(1,1) for instance is -0.393. I am sure my tired eyes just can't find the simple problem.