Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想更改 PDL 矩阵中的值:
前任 :
my $matrix= pdl [[1,2,3],[4,5,6]]; $matrix->at(0,0)=0;
但这不起作用...
谢谢您的帮助
这是使用.= 赋值运算符range的一种方法:
range
my $matrix= pdl [[1,2,3],[4,5,6]]; print $matrix; $matrix->range([0,0]) .= 0; print $matrix;
输出:
[ [1 2 3] [4 5 6] ] [ [0 2 3] [4 5 6] ]
这是最近对 PDL 的快速介绍。