# help in matrix

• 03-10-2012, 06:41 PM
eng_hyzoom
help in matrix
hello i hope you are all fine
if i want to do something in a each row every one separated
for example this matrix
3 4 5
2 1 3
6 3 1
i want to say if all elements of row >=3 put all elements of this row=0
we find in this example second row verify this condition
i want new matrix to be
3 4 5
0 0 0
6 3 1
thanks a lot
• 03-10-2012, 07:14 PM
eng_hyzoom
Re: help in matrix
no help ?????
• 03-10-2012, 07:32 PM
Norm
Re: help in matrix
You would need some loops to do that. What code have you tried?
Post your code and show its output
or post the error messages you are getting.
• 03-10-2012, 08:20 PM
eng_hyzoom
Re: help in matrix
Quote:

Originally Posted by Norm
You would need some loops to do that. What code have you tried?
Post your code and show its output
or post the error messages you are getting.

thanks a lot
code iam working in is very complex
can you solve the posted example ?
no error message i want idia doing this
thanks again
• 03-10-2012, 08:25 PM
Norm
Re: help in matrix
Just post code to solve the posted example. Leave the rest of your code off.
Make a simple program that compiles and executes with a 2D array and some loops for solving the shown example.
• 03-10-2012, 09:39 PM
eng_hyzoom
Re: help in matrix
Quote:

Originally Posted by Norm
Just post code to solve the posted example. Leave the rest of your code off.
Make a simple program that compiles and executes with a 2D array and some loops for solving the shown example.

i want help if i know i wouldnt ask :(nod):
i want code solve posted example
• 03-10-2012, 09:45 PM
Norm
Re: help in matrix
You should hire a programmer if you want someone to write your code for you.

You said:
Quote:

code iam working in is very complex
If that is true then this little bit of code will be much simpler.
All it needs is some loops and if statements.
• 03-10-2012, 10:24 PM
eng_hyzoom
Re: help in matrix
Quote:

Originally Posted by Norm
You should hire a programmer if you want someone to write your code for you.

You said:
If that is true then this little bit of code will be much simpler.
All it needs is some loops and if statements.

thanks i learned today new lesson in programming
iam quick boredom from thinking and it is assignment must received after tomorrow
i want finish it and get market and i dont care about learning
thanks again Norm and i will try to solve it
• 03-10-2012, 10:26 PM
Norm
Re: help in matrix
Quote:

Then you have come to the wrong place.
• 03-11-2012, 06:03 AM
subzero1012
Re: help in matrix
I'm unclear about the example output you've posted back in the original post. In your problem statement, you stated the following.

Quote:

i want to say if all elements of row >=3 put all elements of this row=0
Don't you want the first row to be changed to 0's instead of the second row?
• 03-11-2012, 08:32 AM
JosAH
Re: help in matrix
Quote:

Originally Posted by eng_hyzoom
hello i hope you are all fine
if i want to do something in a each row every one separated
for example this matrix
3 4 5
2 1 3
6 3 1
i want to say if all elements of row >=3 put all elements of this row=0
we find in this example second row verify this condition
i want new matrix to be
3 4 5
0 0 0
6 3 1
```for (int i= 0; i < matrix.length; i++)   if (hyzoomCondition(matrix[i]))       Arrays.fill(matrix[i], 0);```