Skip to content

Instantly share code, notes, and snippets.

@plusk01
Last active November 28, 2016 18:09
Show Gist options
  • Save plusk01/64a16b22ce022c461406badaefc417fc to your computer and use it in GitHub Desktop.
Save plusk01/64a16b22ce022c461406badaefc417fc to your computer and use it in GitHub Desktop.
A place for MATLAB conveniences and tips, etc

MATLAB Things

A place to post useful MATLAB things.

Lambda Functions

Complex Multivariate Normal PDF

Like MATLAB's mvnpdf but takes in complex values. See wikipedia. Note that definitions are slightly different. Below, Cz = E{ZZ'}, Pz = E{ZZ.'}, and \Gamma = conj(Cz) - Pz'*inv(Cz)*Pz where X' means Hermitian and X.' means transpose in MATLAB.

cmvnpdf = @(Z,Mz,Cz,Pz)(1/(pi^length(Z)*sqrt(det(Cz)*det(conj(Cz) - Pz'*inv(Cz)*Pz))))*exp(-0.5*[(Z-Mz)' (Z-Mz).']*inv([Cz Pz; Pz' conj(Cz)])*[(Z-Mz); conj(Z-Mz)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment