~(3)返回一个逻辑数组。你必须把它转换成双。使用:
logicalMat = ~眼睛(3);
myMat =双(logicalMat);
myMat (2, 2) = 9;