Hi everybody ! I'm a begginer with matlab gpu fonctionalities. I try to do many matrices inversion with gpu (see code below), and it doesn't work, with error code 'matrix dimensions must agree'. Could you indicate me a way for solving my problem ? Many thanks !
% basic script
vFT= % some array, size M*N
vFT = gpuArray(vFT); pFT = zeros(M,N,'gpuArray'); Mat= %some N*N*M matrix
Mat=gpuArray(Mat); [vFT]=arrayfun(@ComputeVelocity,pFT,Mat,M,N);
% function ComputeVelocity
function [ vFT ] = ComputeVelocity(pFT,Mat,M,N) for k=1:M/2+1 u = Mat(:,:,k)\pFT; vFT(k,:) = u(1:N); end end
Best Answer