回 帖 发 新 帖 刷新版面

主题:[讨论]求助matlab精度问题

最近做一篇论文时,发现我程序计算中有个数据很大,超过 matlab中默认的精度,如 exp(900),他里面显示inf,怎样才能通过调整精度,解决问题。本人是初学者,希望请问各位matlab高手,能够给予帮助,非常感谢!!

回复列表 (共3个回复)

沙发

此帖怎么没人回答?
我的问题比较类似,不是inf,是NaN

板凳

我只知道有个函数format能调整,help里面有format的用法,不知道能不能帮上忙
   FORMAT SHORT     Scaled fixed point format with 5 digits.
      FORMAT LONG      Scaled fixed point format with 15 digits for double
                       and 7 digits for single.
      FORMAT SHORT E   Floating point format with 5 digits.
      FORMAT LONG E    Floating point format with 15 digits for double and
                       7 digits for single.
      FORMAT SHORT G   Best of fixed or floating point format with 5 
                       digits.
      FORMAT LONG G    Best of fixed or floating point format with 15 
                       digits for double and 7 digits for single.
      FORMAT SHORT ENG Engineering format that has at least 5 digits
                       and a power that is a multiple of three
      FORMAT LONG ENG  Engineering format that has exactly 16 significant
                       digits and a power that is a multiple of three.

3 楼

exp(900)
已经超出matlab的计算范围

matlab一般只在10e-308 到10e308之间

我来回复

您尚未登录,请登录后再回复。点此登录或注册