test.txt 文档中保存了有符号16进制数,位宽为17bit:fid=fopen('test.txt',rb);data=fscanf(fid,'%x');fclose(fid);index = data > 2^16-1;t(index) = t(index) - 2^17;以上代码参考mathwork.com