Skip to content

Commit

Permalink
Fix computation of gram matrix (#2475)
Browse files Browse the repository at this point in the history
Remove unnecessary transpose and replace cell2mat with cat for efficiency.
  • Loading branch information
tchaase authored Jan 30, 2025
1 parent 007fbac commit 80c6e09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inverse/ft_inverse_sloreta.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@

if ~hasfilter
% compute the Gram matrix and its inversion across all voxels
L = cell2mat(sourcemodel.leadfield');
L = cat(2,sourcemodel.leadfield{:});
G = L*L'; % Gram matrix
invG = inv(G + lambda * eye(size(G))); % regularized G^-1
end
Expand Down

0 comments on commit 80c6e09

Please sign in to comment.