Results 1 to 3 of 3
Thread: Help with arrays and matrices!
- 02-14-2013, 11:21 PM #1
Member
- Join Date
- Feb 2013
- Posts
- 4
- Rep Power
- 0
Help with arrays and matrices!
I need to multiply two matrices. One has the values interger 0-10 where the values were created randomly and the other one has double values. Both are the same size of 5x31. If I go ahead and print them they look like they have been generated right. This is what I have so far.
If there is an easier approach to this let me know. I've been looking around for a bit and i can't get it to work! Thanks in advance!Java Code:i = preciomatriz.length; j = ranarray.length; for(x=0; x<i; x++){ for(y=0; y<=j; y++){ for ( z=0; z<=j; z++) { ventasxdia[x][y] += (double)(preciomatriz[x][z]*ranarray[z][y]); System.out.println(ventasxdia[x][y]+" "); } } }
- 02-15-2013, 12:14 AM #2
Member
- Join Date
- Nov 2012
- Posts
- 29
- Rep Power
- 0
Re: Help with arrays and matrices!
idk about a way to do this, but looks to me that 5x31 and 5x31 matrices wouldn't normally multiple with each other. 5x31 and 31x5 would, because rows of 1st= columns of 2nd. if this is different in arrays, my apologies.
- 02-15-2013, 12:34 AM #3
Member
- Join Date
- Feb 2013
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Help with arrays and matrices!
By chwex in forum New To JavaReplies: 3Last Post: 02-13-2013, 11:46 AM -
Arrays and Matrices
By Shaeman111 in forum New To JavaReplies: 2Last Post: 11-10-2012, 07:24 AM -
how to add columns from Matrices(2D array)
By John_shok in forum New To JavaReplies: 7Last Post: 10-04-2010, 04:33 PM -
Read two matrices from file
By zenitis in forum New To JavaReplies: 13Last Post: 05-20-2010, 03:03 AM -
How to multiply two matrices
By Java Tip in forum java.langReplies: 0Last Post: 04-14-2008, 08:50 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks