jStat( matrix ).dimensions() === { cols: 3, rows: 2 };
或传递给回调函数进行异步计算。 这可以连续的链接方法到jStat对象。注意回调函数里的 this 指的是调用的jStat对象。
jStat( matrix ).dimensions(function( d ) {
// d === { cols: 3, rows: 2 }
});
row()
返回矩阵的行。 row( array, index )
var matrix = [[1,2,3],[4,5,6],[7,8,9]];
jStat.row( matrix, 0 ) === [1,2,3];
jStat.row( matrix, [0,1] ) === [[1,2,3],[4,5,6]]
fn.row( index[, callback] )
jStat( matrix ).row( 0 ) === jStat([1,2,3]);
或传递给回调函数进行异步计算。 这可以连续的链接方法到jStat对象。注意回调函数里的 this 指的是调用的jStat对象。
jStat( matrix ).row( 0, function( d ) {
// d === jStat([1,2,3])
});
col()
以列向量的形式返回指定的列。
col( index )
var matrix = [[1,2,3],[4,5,6],[7,8,9]];
jStat.col( matrix, 0 ) === [[1],[4],[7]];
jStat.col( matrix,[0,1] ) === [[1,2],[4,5],[7,8]]
fn.col( index[, callback] )
jStat( matrix ).col( 0 ) === jStat([[1],[4],[7]]);
或传递给回调函数进行异步计算。 这可以连续的链接方法到jStat对象。注意回调函数里的 this 指的是调用的jStat对象。
jStat( matrix ).col( 0, function( d ) {
// d === jStat([[1],[3]])
})
diag()
返回矩阵的对角。
diag( array )
var matrix = [[1,2,3],[4,5,6],[7,8,9]];
jStat.diag( matrix ) === [[1],[5],[9]];
jStat( matrix ).diag() === jStat([[1],[5],[9]]);
或传递给回调函数进行异步计算。 这可以连续的链接方法到jStat对象。注意回调函数里的 this 指的是调用的jStat对象。
评论0
最新资源