请教Matlab中strread的使用

如题所述

[A, B, ...] = strread('str', 'format')
[A, B, ...] = strread('str', 'format', N)
format里面的'%w.pf'
如果学习过C应该很好理解了
w为显示数值的宽,p为精度

如果strread('0.231','%5.3f')
就是显示宽度为5位(包括小数点),其中三位小数(精度)
得到
ans =

0.2310
可以看doc strread的解释:Read field width specified by w. The %f format supports %w.pf, where w is the field width and p is the precision.
温馨提示:答案为网友推荐,仅供参考