How to make DFT in matlab without FFT
As mentioned by the applesoup, you should try dftmtx(). However, if you want to write a code for generating the DFT matrix, here it is,

funtion dftmatrix = myDFTmtx(N)

    dftmatrix = [];
    for k = 0:N-1
        row = [];
        for n = 0:N-1
            row = [row exp(-j*2*pi*k*n/N)];
        end
        dftmatrix = [dftmatrix; row];
    end
end


The matrix returned by this function when multiplied with the time domain sequence or column vector, will return its DFT coefficients.