
10

如何实现 Matlab 多重 parfor 循环
source link: https://zhiqiang.org/coding/matlab-multi-parfor.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

如何实现 Matlab 多重 parfor 循环
我们知道 Matlab 不支持多重 parfor 循环。下面代码会出错:
parfor i = 1:M parfor j = 1:N A(i, j) = i + j; end end
只能换一种方法:
parfor ij = 1:M*N i = rem(ij, M) + 1; j = ceil(ij, M) + 1; A(ij) = i + j; end
Q. E. D.

类似文章:
Matlab 的 parfor 的使用条件 相似度: 0.495
Matlab 的并行计算 相似度: 0.215
以下对并行计算的个人理解受到较多质疑,删除之。
Matlab 的 for 循环 相似度: 0.189
最近写了一些 Matlab 程序,想起以前想过的一个东西,记录一下。
使用 Matlab 的函数包实现命名空间 相似度: 0.105
Matlab 打开和关闭时自动执行的脚本 相似度: 0.104
Python 的多线程和并行 相似度: 0.094
获取 Matlab 函数的路径 相似度: 0.085
配置 64 位 Matlab 的编译器 相似度: 0.074
Matlab 中用类封装函数 相似度: 0.070
上次大规模使用 Matlab 还是本科的时候,当时还是 5.3 版,现在重新尝试它,已经是 7.8 ( R2009a ),而且 R2010b 版都已经发售。而这些版本引入的一个新玩意儿便是面向对象化编程( object-oriented programming , OOP )。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK