【matlab】双精度每字符占8字节,单精度每字符占4字节

>> help magic
magic - Magic square

    This MATLAB function returns an n-by-n matrix constructed from the integers 1
    through n^2 with equal row and column sums.

    M = magic(n)

    magic 的参考页

    另请参阅 ones, rand

>> a = magic(4)

a =

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

>> whos a
  Name      Size            Bytes  Class     Attributes

  a         4x4               128  double              

>> b = single(a)

b =

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

>> whos b
  Name      Size            Bytes  Class     Attributes

  b         4x4                64  single       

你可能感兴趣的:(MATLAB,Matlab笔记)