MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MatLab到Python的转换-索引编制吗? (https://www.labfans.com/bbs/showthread.php?t=22310)

poster 2019-12-01 05:02

MatLab到Python的转换-索引编制吗?
 
我正在尝试将以下MatLab代码转换为Python:

for i = 1:n I = (sum((N==M(1,i))+(N==M(2,i)))==2); P(:,i) = pit(:,I); 有人可以帮我从哪里开始吗?

for i = 1:n 将会

for range(0,n): 对?

我已经计算出N == M的情况需要用int()包装。

我不了解I =()格式



P(:,i) = pit(:,I); 只是成为

P[:,i] = pit[:,I] ?

我不确定您是否可以在Python中进行分配。

任何帮助,不胜感激。

顺便说一下,从MatLab到Python的转换器libermate并没有真正更新这一点。结果几乎一样。



[url=https://stackoverflow.com/q/59120179]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 19:40

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.