I am currently developing a class to represent matrices, it represents any general mxn matrix. I have worked out addition and scalar multiplication but I am struggling to develop the multiplication of two matrices. The data of the matrix is held in a 2D array of doubles. The method looks a little bit like this: It will return the product

# Tag: multidimensional-array

## How to rotate an array counter clockwise and invert it vertically?

Say each pixel in this picture(fig 1) is an element in an array. How would I rotate it 90 degress counter-clockwise(fig 2) and invert it vertically(fig 3)? figure 1: figure 2: figure 3: My current codes are: The invert does the same function as the rotate though. Any help? Answer seems like you are trying to transpose the array (fig3

## Pascal’s triangle 2d array – formatting printed output

I have a small assignment where I have to use a 2d array to produce Pascal’s triangle. Here is my code, and it works. There is an extra credit opportunity if I display the triangle like so: However, my spacing is not formatted like that. it simply displays the numbers all lined up on the left. its hard to describe

## How to create a Multidimensional ArrayList in Java?

I’m fairly new to ArrayLists anyway but I need them for this project I’m doing so if you guys could help me I would be more than grateful! Basically, I need to create a multidemensional ArrayList to hold String values. I know how to do this with a standard array, like so public static String[][] array = {{}} but this