If you have an Nvidia Graphic Card, you must install nvidia drivers to get the best performance. To save an array to your GPU memory, just save it with gpuArray and to return it to your Ram use gather . A simple CPU example is the following: function [time]= cpu(n) A = rand(n,n); tic; B = fft(A); time = toc; If we want use the GPU, just add the bold lines: function [time]= gpu(n) A = rand(n,n); % send A to the GPU A = gpuArray(A); tic; B = fft(A); time = toc % return B to the CPU B = gather(B) To know how many bytes will need your CPU to storage a gpuArray, before gather it, you can use this equation: numel(B) * 8 for double-precision arrays or numel(B) * 16 if the array is complex To checkout the variable size, use the command: whos If you choise a large value for n, probably you will see the following message: Out of memory on device. To view more detail about available memory on the GPU, use 'gpuDevice()'. If the problem persists, reset