Java tutorial
//package com.java2s; public class Main { public static float maxAPP; public static float[][] compute_amplitude(float[][] real, float[][] imaginary) { float[][] amp = new float[real.length][real.length]; float maxAmp = 0; for (int row = 0; row < amp.length; row++) { for (int col = 0; col < amp.length; col++) { amp[row][col] = (float) Math.hypot(real[row][col], imaginary[row][col]); if (amp[row][col] > maxAmp) { maxAmp = amp[row][col]; } } } maxAPP = maxAmp; return amp; } }