Dividing two arrays in Java

Page 1 of 1

1 Replies - 179 Views - Last Post: 11 July 2012 - 01:10 PM Rate Topic: -----

#1 mhunck  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-July 12

Dividing two arrays in Java

Posted 11 July 2012 - 01:09 PM

I have created two arrays in the Java code I am writing in ImageJ.

  setRGBWeights(1,0,0); r=getProfile();
  setRGBWeights(0,1,0); g=getProfile();



Both r and g variables are then defined as arrays of length 219.
In the Debug window, the value of both r and g are array[219].

I then want to plot the ratio of the two arrays, but I can't figure out how to divide the two arrays by each other.
I tried this, but I keep getting an error when trying to plot rg because it is looking for an array.
  for (i=0; i<219; i++)
     rg=r[i]/g[i]; 



Thanks in advance for the help.

Is This A Good Question/Topic? 0
  • +

Replies To: Dividing two arrays in Java

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10471
  • View blog
  • Posts: 38,809
  • Joined: 27-December 08

Re: Dividing two arrays in Java

Posted 11 July 2012 - 01:10 PM

Please avoid duplicate posting. We also established that you aren't using Java, because in your other thread, you insist your code compiles, yet you try and use a function keyword, which does not exist in Java.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1