matlab中
a = [1,2,3,4];
b = [2,3,4,5];
c = [a;b]; %合并为矩阵
python中
import numpy as np
list1=[]
list2=[]
for i in range(0, 5):
list1.append(i)
list2.append(i*2)
a = np.array([list1,list2]) # 需要加括号[]
print(a)
matlab中
a = [1,2,3,4];
b = [2,3,4,5];
c = [a;b]; %合并为矩阵
python中
import numpy as np
list1=[]
list2=[]
for i in range(0, 5):
list1.append(i)
list2.append(i*2)
a = np.array([list1,list2]) # 需要加括号[]
print(a)