matlab中如何将矩阵转化为一维数组

2024-11-01 01:38:04
推荐回答(1个)
回答1:

x=[1 2 3;4 5 6;7 8 9]
x=x(:)

x =

1 2 3
4 5 6
7 8 9

x =

1
4
7
2
5
8
3
6
9