Matlab矩阵数格式化太长(符号值系数)

时间:2014-03-16 08:30:39

标签: matlab matlab-guide

这应该很简单,但我似乎无法在任何地方找到答案:

我有一个2x2矩阵,它是通过使用adjoint / determinant计算的。 返回的矩阵是愚蠢的大。

 +-                                                                                                                                                                                                                                        -+ 
  |                                                       s + 6/5                                                                                                         4830385804397659                                                   | 
  |             --------------------------------------------------------------------------------------------,           - -----------------------------------------------------------------------------------------------------------------  | 
  |              2   24700384724018671 s                                                                                                   /  2   24700384724018671 s                                                                     \  | 
  |             s  + ------------------- - 119336023372378697084501879995957/1584563250285286751870879006720              9007199254740992 | s  + ------------------- - 119336023372378697084501879995957/1584563250285286751870879006720 |  | 
  |                   1407374883553280                                                                                                     \       1407374883553280                                                                       /  | 
  |                                                                                                                                                                                                                                          | 
  |                                                   6228340816450595                                                                                          s + 4602306972750947/281474976710656                                         | 
  |  - ---------------------------------------------------------------------------------------------------------------,             --------------------------------------------------------------------------------------------             | 
  |                   /  2   24700384724018671 s                                                                     \               2   24700384724018671 s                                                                                 | 
  |    35184372088832 | s  + ------------------- - 119336023372378697084501879995957/1584563250285286751870879006720 |              s  + ------------------- - 119336023372378697084501879995957/1584563250285286751870879006720             | 
  |                   \       1407374883553280                                                                       /                    1407374883553280                                                                                   | 
  +-                                                                                                                                                                                                                                        -+

我想将细胞缩短一点,比如s * 1.7551e + 01。

是的,s是象征性的,我想评估系数或至少用科学记数法表达它们。我试过format short ead./detr没有运气。

提前谢谢

1 个答案:

答案 0 :(得分:0)

我正在寻找的功能是vpa()

在这种情况下的用法:vpa(ad./detr)现在给出:

 +-                                                                                                                                                                -+ 
  |                                     s + 1.2                                                             0.53628055378647887518894776803791                       | 
  |   ----------------------------------------------------------------------------,  - ----------------------------------------------------------------------------  | 
  |    2                                                                                2                                                                            | 
  |   s  + 17.550678936131213703220055322163 s - 75.311618738408384768789333762935     s  + 17.550678936131213703220055322163 s - 75.311618738408384768789333762935  | 
  |                                                                                                                                                                  | 
  |                          177.0200929186840710372052853927                                            s + 16.350678936131213703220055322163                       | 
  |  - ----------------------------------------------------------------------------,  ----------------------------------------------------------------------------   | 
  |     2                                                                              2                                                                             | 
  |    s  + 17.550678936131213703220055322163 s - 75.311618738408384768789333762935   s  + 17.550678936131213703220055322163 s - 75.311618738408384768789333762935   | 
  +-                                                                                                                                                                -+
>>