41,311 questions
0
votes
0
answers
43
views
I get an error while normalizing data in R: "number of items to replace is not a multiple of replacement length" [closed]
I'm just starting with R since I'm working on a project where I try to calculate the CoVaR of 10 sector indices using 3 commodities. For this, I use the TENET method from Hardle,and the R code he uses ...
1
vote
1
answer
46
views
How to convert matrix of binary numbers into matrix of strings/symbols?
I have a matrix in Python consisting of 1s and 0s. As an example:
m= [1 0 1]
[1 1 1]
[0 0 1]
I would like to convert it to a matrix of symbols/strings. An example of the output I'm ...
0
votes
1
answer
64
views
Generalized eigenvalue problem in python. What am I doing wrong?
I am trying to solve the generalized eigenvalue problem, Ax=bBx where A and B are m x m matrices and I am trying to find b (which is a number) in python. I have ran into a problem. I am using eigh ...
1
vote
1
answer
40
views
Pair up elements from two differently dimensioned matrices with a nested loop
I have the following exercise involving 2 matrices – the first being ‘Equipment available to four leagues’, the second being the ‘teams per league’ (i.e, two teams per league). Note, there is ...
0
votes
0
answers
27
views
How to use Matrix API with curl
When trying to check the availability of usernames at the matrix.org server using the Matrix protocol with the following command
curl -H "Content-Type: application/json" -X GET "https://...
-1
votes
0
answers
41
views
I am working on 2D rendering in Avalonia C#
I am working on 2D rendering in Avalonia and have drawn lines, circles, and other entities using the DrawingContext in the control's Render override method. I am using the Matrix class for scaling and ...
6
votes
2
answers
92
views
Printing numpy matrices horizontally on the console
Numpy has many nice features for formatted output, but something I miss is the ability to print more than one array/matrix on the same line. What I mean is easiest to explain with an example. Given ...
1
vote
1
answer
31
views
Getting an error while mutating a matrix this way
I am trying to find the determinant of a 4x4 matrix using nested list operations. I gave the following code
def determinant_4x4(matrix: list[list[int|float]]) -> float:
# Your recursive ...
0
votes
0
answers
35
views
Matrix Multiplication Error in MATLAB R2022 but Not in R2024 (ECEF-to-ECI Transformation)
I'm running a MATLAB script on macOS that performs sensor fusion using GNSS and IMU data. The script runs perfectly in MATLAB R2024 but fails in MATLAB R2022 with the following error during the ECEF ...
1
vote
1
answer
53
views
Identifying loops in a network diagram and converting this to node pathways in a dataframe
I'm working with networks like these:
mat1 <- matrix(
c(
-1, -1, -1, 0, 0,
1, -1, -1, 0, 0,
1, 1, 0, -1, -1,
0, 0, 1, -1, 0,
0, 0, 1, 0, -1
),
nrow = 5, ncol = 5, byrow = ...
0
votes
1
answer
34
views
How do I successfully assign a function to the on_click event?
I am new in this stuff, I am currently working in a school project about a matrix calculator, I want to enter the two matrix and that when I click a button the solution of the operation gets printed.
...
0
votes
0
answers
24
views
Find a Point by using Transformation Matrix and Inverse Tranformation Matrix
I have prepared simple code. I need to verify firstframe_center_point by using inverse second_frame_matrix and secondframe_center_point,however, there is a small mistake in my way. I have simply ...
1
vote
1
answer
47
views
Testing a matrix to see if it is unitary or Hermitian
I'm using this:
(ma:ident(3),ma[1,1]:%i/2,ma[1,3]:sqrt(3)/2,ma[3,1]:sqrt(3)/2,ma[3,3]:-%i/2,ma);
It gives a 3x3 matrix which I expect to be unitary.
But when trying to test it by using is(ma,(unitary)...
4
votes
3
answers
100
views
create a matrix of 0s and 1s based on vector labels
I have a vector:
A <- c("CTRL", "A", "B", "C")
I would like to generate this matrix:
[A] [B] [C] [CTRIL
[A-CTRL] 1 0. 0. -1
[B-...
1
vote
4
answers
139
views
Why can't I use nested for loops to change values in matrices? [duplicate]
I believe I'm missing something fundamental when it comes to for loops and/or matrices.
def change_value(my_matrix: list, increase: int):
for row in my_matrix:
for column in row:
...