41,259 questions
0
votes
1
answer
27
views
Using a colour matrix to isolate only yellow out of a grayscale
I do apologise if this is an incredibly dumb question, because I know it is,
I have no experience with colour matrices and the information I can find online to learn about them is unhelpful at best ...
1
vote
1
answer
52
views
What is the correct NumPy representation of a row vector for gradients
I am doing an assignment on matrices and gradients, where the final answer must be expressed as a row vector.
vr = np.array([1, 2, 3])
vrr = np.array([[1, 2, 3]])
Mathematically, a row vector should ...
0
votes
0
answers
39
views
Get CSS RotateZ() from matrix3d [closed]
I am trying to determine an angle of rotation dynamically within an animation for each frame. The object is only rotating on its Z axis and after some research I found that the best method is probably ...
3
votes
0
answers
98
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 ...
2
votes
2
answers
135
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
167
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 ...
2
votes
0
answers
88
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
168
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 ...
2
votes
0
answers
56
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
65
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
243
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
200
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
265
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
146
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
168
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 ...