Skip to content

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 …

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. T…

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 c…