elementwise-operations
elementwise binding in R
I want a function f such that (outer(X, Y, f))[i, j] is a side-by-side concatenation of the i-th element of X and the j-th element of Y, something like c(X[i], Y[j]), or having a similar structure.[详细]
2023-03-09 18:47 分类:问答inconsistent results using isreal
Take this simple example: a = [1 2i]; x = zeros(1,length(a)); for n=1:length(a) x(n) = isreal(a(n)); end In an attempt to vectorize the code, I tried:[详细]
2023-01-13 13:34 分类:问答Element-wise array replication according to a count [duplicate]
This question already has answers here: Repeat copies of array elements: Run-length decoding in MATLAB[详细]
2022-12-22 03:03 分类:问答