
matlab与python区别汇总
matlab与python区别汇总
飞天水龙头
这个作者很懒,什么都没留下…
展开
-
matlab转python之——数列合并为矩阵
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)原创 2020-12-29 17:19:25 · 364 阅读 · 0 评论 -
matlab转python之——如何利用python顺序写入向量
在matlab中,我们可以很简单的写入一个数组或者矩阵,例如 for i = 1:100 a(i) = i*2; end 但python中我们想要实现相同功能,需要使用append。 list1=[] for i in range(0, 5): list1.append(i) print(list1)原创 2020-12-29 16:37:00 · 466 阅读 · 0 评论