Hand written DFT vs MATLAB FFT has flipped conjugates?

I had to compute the DFT of a signal with 5 points with a hand-written method and using MATLAB's FFT just to see if they are equal. Taking the absolute value of both gives the same spectrum, however the conjugates are in a different order for both. Why is this?

values using handwritten DFT, negative conjugates first

values using MATLAB FFT, positive conjugates first

The code I used is shown below

Now we compute the DFT of the finite sequence to show that DFT is
actually a sampled version of the DTFT.

N=5;
W=exp(-1i*2*pi/N); %the complex term W_N defined in lecture 2;
DFTmatrix = W.^((0:N-1)'*(0:N-1)); %the DFT matrix of size N
%Multiply the DFT matrix with the time-domain samples to get DFT
DFTofTruncatedSampledSignal = DFTmatrix*sampledsignal.';

FFTSpectrum =fft(sampledsignal,N)'; %MATLAB fft function to compute DFT

• The matrix multiplication in MATLAB is a complex conjugate multiplication. Feb 19 '20 at 1:59
• @Dan: No, it is not. Feb 20 '20 at 17:18
• Ah my mistake- it is the transpose that’s is the complex conjugate. Thanks @CrisLuengo Feb 20 '20 at 17:21

FFTSpectrum = fft(sampledsignal,N)';

Note that in MATLAB, ' is the complex conjugate transpose. Use .' to transpose a matrix without applying the complex conjugation.