sigma = stressTensor.uniaxial(xvector);% compute Schmid factor for all slip systems in the specific grainSF = sS.SchmidFactor(inv(grains(3).meanOrientation) * sigma);% find the maximum Schmidt factor[SFmax,active] = max(SF);SFmax