楼主:
sppmg (sppmg)
2018-07-03 01:49:18没仔细想修正方法。直接给你“比较快”的作法。
matlab 要快要向量化写法,我在 octave + 弱笔电执行我的程式后的输出为:
answer same, for = 1.06e+01 s, vec = 1.71e-02 s
Vectorization 619.79 x faster then for loop.
Original outer number is 10000, after mod() is 0
这程式假设你ao,bo,co 都是常数、不随位置改变。
以下程式
(注:其中的 clear -x ... 在 matlab 要改用 clearvars -except ...)