# Getting different output for fft function in julia and matlab

**URL:** <https://discourse.julialang.org/t/getting-different-output-for-fft-function-in-julia-and-matlab/63349>\
**Category:** Signal and Image Processing\
**Tags:** fftw, matlab, matrices\
**Created:** [June 22, 2021, 6:30am UTC](https://discourse.julialang.org/t/getting-different-output-for-fft-function-in-julia-and-matlab/63349 "2021-06-22T06:30:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [June 22, 2021, 8:15am UTC](https://discourse.julialang.org/t/getting-different-output-for-fft-function-in-julia-and-matlab/63349/4 "2021-06-22T08:15:18Z")

</div>

You can just give `fft` the dimensions:

```julia
help?> fft

  fft(A [, dims])                                                                                                                                                                    

  Performs a multidimensional FFT of the array A. The optional dims argument specifies an iterable subset of dimensions (e.g. an integer, range, tuple, or array) to transform along.
   [...]

julia> m                                                                      
2×5 Matrix{Float64}:                                                          
 0.801514 1.21987 1.1503 1.18761 1.2485                                  
 0.807469 1.22325 1.14981 1.1877 1.24861                                 
                                                                              
julia> fft(m, (1,)) # first dimension is the column, since julia is column major
2×5 Matrix{ComplexF64}:                                                       
   1.60898+0.0im 2.44312+0.0im 2.30011+0.0im 2.37531+0.0im 2.49711+0.0im
 -0.005955+0.0im -0.00338+0.0im 0.00049+0.0im -9.0e-5+0.0im -0.00011+0.0im

```

In general, if you type `?` at the julia REPL, you’ll enter `help` mode, where you can enter e.g. the name of a function and it’ll print any associated documentation attached to that function (if any is made available by the package developers).

* * *

As an aside, it’s a little hard to read what output you expected, please surround your code in the future with triple backticks (```) to mark them as code 🙂 For more information about making it easier for people to help you, please refer to this thread: [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

---

_[View the full topic](https://discourse.julialang.org/t/getting-different-output-for-fft-function-in-julia-and-matlab/63349)._
