Cannot perform the operation: {convex} .* {positive constant}

I’m not clear on exactly what error message you received when. Perhaps Error message with {invalid} is due to NaN, Inf, or -Inf in input data is relevant.