Find the missing number in these grids. I was unable to find any pattern.
source: Borhan Motevasete magazine, Oct. 2007
Edit: Changed the reasoning based on Jaap Scherphuis's comment as it seems more natural.
I think the answer is
Add the numbers in the lower four boxes and take the absolute difference between the digits in the result to the get the number at the top (Originally: take the residue modulo $11$ to get the number at the top)
$4+1+6+3 = 14 \rightarrow |1-4| = 3$
$9+2+7+8 = 26 \rightarrow |2-6| = 4$
$3+1+8+5 = 17 \rightarrow |1-7| = 6$