% 加行代码判断,得知PHS第二个数值实际小于1
PHS<1
% 向上取整避免该问题
mod(ceil(PHS),1)
具体为啥会小于1也不清楚
目前,根据mod函数的帮助文档说明:
b = mod(a,m) returns the remainder after division of a by m, where a is the dividend and m is the divisor. This function is often called the modulo operation, which can be expressed as b = a - m.*floor(a./m). The mod function follows the convention that mod(a,0) returns a.
发现问题出现在m.*floor(a./m),此部分返回的结果是[1 0 1],也是说明了PHS的第二个值是小于1,导致向下取整为0。待高手解答