All Questions
220
questions
0
votes
1
answer
37
views
find the largest sub matrix
the larget sub matrix with odd size
import numpy as np
array = np.array([[np.nan, 255, 255, 0, 0, 0, 0, 0, 255, np.nan],
[np.nan, 255, 255, 255, 0, 0, 0, 0, 255, np.nan],
...
1
vote
2
answers
86
views
Initialize a two-dimensional array with the values shown in the table below
Initialize a two-dimensional array with the values shown in the table below
1 0 0 0 1 0 0 0 1 0
0 4 0 0 0 4 0 0 0 4
0 0 9 0 0 0 9 0 0 0
0 0 0 ...
1
vote
1
answer
35
views
Mapping 2d point (x,y) into grid index (row,col)
I have a particular **Grid ** for robot navigation showing as so:
I have scaled this by a factor of 10 to create my Environment. This is given in Cartesian coordinates
I would like to map a point in ...
0
votes
1
answer
32
views
Algorithm for allocating multiple 2d spaces in a matrix
Can anyone point me in the direction of an algorithm or concept which could do the below. My searches so far led me to "Shelf space allocation" and "Memory allocation". But I feel ...
0
votes
0
answers
137
views
Rotating a cube in 2D space
I'm building my own "Graphics Library" which manipulates PPM files under the hood. The library can create videos, too, by utilizing ffmpeg. My library mainly does 2D videos, but I wanted to ...
1
vote
1
answer
32
views
Python list with multiple 2D list append same value to first row of each value
I have a list like this:
a = [[[0, 1], [1, 1]], [[1, 0], [1, 1]]]
Which means i have two 2D list inside a list:
a[0] = [0, 1], [1, 1]
a[1] = [1, 0], [1, 1]
and i would like to append the ...
0
votes
0
answers
36
views
How to access an element from a 2D array, with non-sequential row and column data - C#
I need to access a text file containing some data gathered from the machine from two testing planes. One plane is vertical and creates rows that can be 1-180 degrees with 1, 5 or 10-degree intervals, ...
-3
votes
1
answer
45
views
What is wrong in my code of 2d array by taking input from user using c [duplicate]
#include<stdio.h>
int main()
{
int i,j,m,n;
int a[m][n];
printf("enter the row of matrix:");
scanf("%d", &m);
printf("enter the column of ...
-1
votes
2
answers
62
views
how can a write a 2-d array without any imports?
Anyone know how to write a 2d array?
The result:
[[0,1,0]
[0,2,0]
[0,3,0]]
And with no imports or any library:
a=[]
for y in range (3):
row=[]
for x in range (3):
row.append(0)
...
0
votes
1
answer
61
views
What is the best practise when working with 2D arrays in C, if it exists?
Question: What is the best practise when working with 2D arrays in C, if it exists?
As far as I program in C I always get my mind confused whenever using 2D arrays would be convenient.
I like ...
1
vote
1
answer
168
views
Javascript matrix check neighbor state to find edges
i am making a virtual Hama beads tool online. (its a kids toy where you put plastic beads on a matrix and iron them to make them stick together and form a solid shape)like this one below (real hama)
...
0
votes
2
answers
103
views
How to store multiple 2D matrices in Python
I want to store 2D matrices in a another list or container.
I have 5 different 2d matrices. Each matrix has a size 36 X 36. I want my output as below,
big_matrix = [ [36 X 36], [36 X 36], [36 X 36], [...
-1
votes
2
answers
33
views
Why won't the average column amount not calculate?
I want to print out the average amount of an 2D array column, by filling the matrix with random numbers
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int m = 0;
int ...
0
votes
0
answers
253
views
How to find the maximum element in a column in a matrix and display the index(row number of the maximum element)?
I have a matrix of M rows and N columns. How do I find the maximum element in each column and display the index(i.e., the row number of the Maximum element)?
Ex: (Considering a 2x2 matrix)
Input:
1 5
...
0
votes
0
answers
113
views
Split a 2d array into four equal parts
I'm pretty new to programming in general. I have a 2d array that I have to split into 4 equal parts. The size of the array is a number that is the power of 2.
The tricky part is, that I have to check ...