Comparing Image FFT with Sine wave FFT
x = [0 0 0 0 1 1 1 1] is one cycle of a (not bandlimited) square wave, with a DC offset, with a period equal to the period of the window.

....''''....''''....''''


The DC component is the FFT value at index 1 (remember that Matlab's array indexing starts at 1 instead of the more sane 0-based indexing), and to get the true value you have to divide by the number of samples (4/8 = 1/2 DC offset).  The square wave is the components at index 2 and 4.  Because the signal is real, the components at 6, 7, 8 are just mirror images of 4, 3, 2.

A square wave is made up of odd harmonics with 1/n amplitude, so with fundamental f1


frequency   f1, amplitude   1
frequency 3*f1, amplitude 1/3
frequency 5*f1, amplitude 1/5
frequency 7*f1, amplitude 1/7
...


Since your number of samples is so low, you only have room for the first 2 harmonics before you hit the Nyquist frequency.  So the value at index 4 is the 3rd harmonic, which should be approximately 1/3 of the value at index 2, the first harmonic (though not exactly 1/3 because of aliasing).

If your sampling frequency is 1 MHz, and the value at index 2 represents the fundamental frequency, then you know the square wave fundamental frequency is (index-1)*fs/N = (2-1)*1MHz/8 = 125 kHz, or 1/8th of the sampling frequency, as you would expect.

Try experimenting with longer signals and it will be easier to see what's happening.