How to use the index function from mathjs
Find comprehensive JavaScript mathjs.index code examples handpicked from public code repositorys.
13 14 15 16 17 18 19 20 21 22
let index; let scale; let col; for (let j = 0; j < nCols; j += 1) { index = math.index(math.range(0, nCols), j); col = matrix.subset(index); scale = norm(col, p); if (scale > 0) {
4
5
3
159 160 161 162 163 164 165 166 167 168
return {"frequencies": frequencies, "spectrum": spectrums}; } getRelevantIndeces(minFreq, maxFreq, windowSize) { // Returns indeces in the frequency array bounded by minFreq and maxFreq return math.index(math.range(Math.ceil(minFreq*windowSize/this.SAMPLING_FREQ), Math.floor(maxFreq*windowSize/this.SAMPLING_FREQ), true)); } getFFTBand(fft, minFreq, maxFreq, windowSize) { // get average power in the frequency bands bounded by minFreq and maxFreq
1
0
0
GitHub: Phochara/Numerpro
85 86 87 88 89 90 91 92 93 94
data["x"].push( math.round( math.det( math.subset( a, math.index(math.range(0, a.size()[0]), i), math.subset(b, math.index(math.range(0, a.size()[0]), 0)) ) ) ) / math.round(math.det(a))
0
0
0
GitHub: mljs/optimization
11 12 13 14 15 16 17 18 19
* */ _toNormalVector : function(vect) { var normalVector = []; var size = math.subset(math.size(vect), math.index(1)); for (var i = 0; i < size; ++i) { normalVector.push(math.subset(vect, math.index(0, i))); } return normalVector; },
0
0
0
+ 4 other calls in file
mathjs.evaluate is the most popular function in mathjs (87200 examples)