>> 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】双精度每字符占8字节,单精度每字符占4字节
最新推荐文章于 2022-07-15 00:43:08 发布