41,259 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
40
views
Storage: for each sim we store covariate mean difference vector (length p1 or p2) [closed]
I ran this code:
# Storage: for each sim we store covariate mean difference vector (length p1 or p2)
diffs_pure_t1 <- matrix(NA, nrow = Nsim, ncol = p1)
diffs_rerand_t1 <- matrix(NA, nrow = ...
3
votes
0
answers
90
views
How can I plot diagonals of matrix?
I want to plot all the diagonals of a matrix. In the matrix row 1 contains information of time 1, row 2 of time 2 etc etc. Each diagonal presents the evolution of the number of fishes in a cohort that ...
-3
votes
1
answer
235
views
C++ matrix class' operator* returns wrong answer [closed]
I've been tasked to write a code which implements a matrix class with a typical set of matrix operations, for example multiplying matrices with entries taken mod 1000 (EDIT: the dimensions are bounded ...
2
votes
2
answers
133
views
Applying a function to two matrices column-by-column
Short version: How do I vectorize two matrices A and B by column so that I can pass the 1st, 2nd, ..., ith column of A and the 1st, 2nd, ..., ith column of B to a function without a loop?
I have two ...
0
votes
1
answer
162
views
Why do my loops not start? Indexing loops problems?
I'm trying to convert a SAS program into a R one and I have stumbled at the for() loop and array part. It keeps saying in the log:
"Error in for (. in i) seq_len(NBR_LIGNES_MAX) : 4 arguments ...
1
vote
0
answers
83
views
How to properly allocate dynamic memory for matrix operations in C [duplicate]
I am trying to learn C, and I want to specifically work with arrays and matrices as I do scientific simulations (coming from python!!). After writing few basic 1-D array codes in C, I am going for ...
1
vote
2
answers
164
views
2D matrix convolution with convolve() in R
I am trying to perform 2D matrix processing (convolution) by applying a kernel/filter to a large matrix. There is a built-in function convolve that can perform convolution. It offers three different ...
1
vote
0
answers
45
views
How to implement inbound PSTN calls to Matrix rooms using a Node.js App Service with LiveKit SIP
I have a self-hosted setup consisting of:
Matrix Synapse (home server)
LiveKit (for media routing)
LiveKit SIP (for PSTN connectivity)
Element client
✅ Working setup
Element → Element calls work ...
0
votes
1
answer
62
views
How do jspdf transformation matrices work?
I am using transformation matrices with jspdf to change the origin and scaling of my drawings. setCurrentTransformationMatrix has no official documentation from what I found (well, except if "...
3
votes
7
answers
221
views
Using spreadsheet to make a pairwise comparison matrix
I want to use a spreadsheet to take a column of rankings and turning into a pairwise matrix. Suppose I had a column like so:
Candidate
Ranking
A
1
B
5
C
3
D
2
E
4
I want to create a 5x5 matrix where ...
2
votes
1
answer
197
views
How to filter and sum elements of a matrix in MATLAB based on multiple conditions without a loop?
I have the following numeric matrix in MATLAB:
A = [3 2 7; 9 1 4; 5 6 8];
I want to sum all elements that are greater than 5 and are also even.
I need to do this without using a loop, and store the ...
3
votes
6
answers
261
views
Is there an R function for placing a vector in the off-diagonal elements of a matrix?
I want to take a vector of some length and arrange it sequentially as the off-diagonal elements of a square matrix (as I want the diagonals to all be 0), using only the default R packages.
I can make ...
1
vote
1
answer
143
views
Why isn't my Hermitian covariance matrix invertible?
I am following a paper that uses a Hermitian covariance matrix
and inverts it to produce a Fisher matrix. I construct my covariance as Gamma[i,m,n], stored inside a larger array of shape (n_z, n_k, ...
2
votes
2
answers
166
views
How to detect singularity of a matrix before inverting it?
I have an algorithm which involves generating a random square matrix and then inverting it. To avoid the program interrupted by numerically singular matrix, I wish to do something like the pseudo-code ...
8
votes
3
answers
1k
views
How can I create an array of arrays of strings of varying lengths in C?
I am trying to solve the problem posed in this question. Here the OP asks that given a 15 element set, its 2^15 element power set be generated in a manner such that the elements of the power set are ...