1、行列向量的转换
例子1:
>> a = [1,2,3]
a =
1 2 3
>> a'
ans =
1
2
3
例子2:
>> a = [1;2;3]
a =
1
2
3
>> a'
ans =
1 2 3
2、向量中元素位置颠倒
例子(行向量):
>> a = [1,2,3,4]
a =
1 2 3 4
>> fliplr(a)
ans =
4 3 2 1
例子(列向量):
>> a = [1;2;3;4]
a =
1
2
3
4
>> flipud(a)
ans =
4
3
2
1
网友评论