Skip to content
Advertisement

Tag: matrix

How to convert lower triangular matrix into a vector?

I want to convert my triangular matrix into a vector. Let’s say I have 7×7 lower triangular matrix. Something like this: And I need to convert this matrix into a vector ignoring zeros. So, the result should be: I have already made a matrix by the following code: But I don’t really get how to convert that into a vector.

Java – generate and rotate matrix

recently I’m trying to learn Java a bit and currently, I’m working on a simple program that should generate a matrix and then rotate it. I’m stuck at the first part. What exactly is the problem? The logic of my code seems to be fine, but anyway program is returning not what I would expect. The code: Output: Please, enter

How to check if contours are the same?

I’ve got two images, the second one is the first one after modification. I find contours of two images and then check if there any same contours. The problem is, that despite contours being the same (drawing contours of one image and another one gives totally same results) after checking that it never becomes true that one contour is equal

Creating a Matrix with ArrayLists

I want to create an ArrayList-matrix with n-rows and m-columns, for example I’ve already written a code for creating such a matrix but my code doesn’t display the values when I clear the list containing the column-data. Here is my Is there any possibility to clear the contents of intList without clearing the contents of mainList?? Answer When calling mainList.add(intList);

Advertisement