function A_inv=inv3d(A)
% Copyright (c) 2013-2018, Francesco Corsello, All Rights Reserved.
[n,~,T]=size(A);
cell_Ainv=arrayfun(@(t) eye(n)/A(:,:,t),1:T,'UniformOutput',false);
A_inv=cell2mat(reshape(cell_Ainv,1,1,T));