We investigate an optoelectronic system that can perform weighting and threshold operations similarly to a neuron. The weighted summation is carried out optically in an optical fiber by using stimulated Brillouin scattering. It is shown that magnitude and sign of a weight associated with an input can be set by changing the signal intensity and wavelength, respectively. A signal traveling in the backward direction is required to sense additions and subtractions. Due to inherent parallel nature of optical processing, this system can outperform a digital system for large numbers of inputs.