Start New Discussion Reply to this Discussion Determining whether the matrix is markov matrix or not
Hi, I'm having problems with this assignment. First off a Markov matrix is simply a 3x3 matrix that when the rows are added always equal 1. I am suppose to write a program to prompt the user to enter a matrix and then it is determined wether or not that matrix is a markov matrix.
This is where im at:
import java.util.*;
public class MarkovMatrix
{
public static void main (String args [])
{
int [][] matrix = new int [3][3];
Scanner input = new Scanner (System.in);
System.out.println("Enter" + matrix.length + "rows and " + matrix[0].length + "columns");
for (int i=0 ; i < matrix.length; i++){
for(int j=0 ; j < matrix[i].length; i++)
{
matrix[i][j] = input.nextInt();
}
}
}
public static boolean isMarkovMatrix(double [][]m)
{
for()
}
}
any help is mucho appreciated
42 Minutes
Discussion Span
Related Article: Java- Round values in a matrix
is a Java discussion thread by alliswim2010 that has 12 replies, was last updated 1 year ago and has been tagged with the keywords: array, java, matrix, round.
Hharla
Newbie Poster
2 posts since Sep 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
solved it, but still lemme know what yall think. also some errors in the code above but i figured that out
Hharla
Newbie Poster
2 posts since Sep 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
© 2013 DaniWeb® LLC
Page rendered in 0.0571 seconds
using 2.66MB