From: Thomas on
Hello,

I'm relatively new to Matlab, and trying to visualize the pdf of a 3-dimensional gaussian mixture model. I started with 3dim data, and fit this using gmdistribution.fit() to 3 components. So now I have a gmdistribution object which is the result of the fit.

I manage to create a 3dim "grid" (using for loops, haven't mastered matlab matrix style yet) as a N x 3 matrix, and can get the pdf values for the N points with pdf( obj, pts) where obj is the gmm distribution and pts are my 3dim points.

But how now to visualize this. I am imagining a plot in which the 3 dimensions give the cartesian coordinate, and the pdf value at that coordinate is indicated by either a shade of gray or a color, such that I see 'volumetric' rendering as a cloud of dots of different shades and/or transparency. It may also then be useful to project this into 2dims.

Thanks for any tips - I've read isosurface, slice, etc, but these don't seem to be what I'm after, and alas am still struggling with matlab syntax. (I'm a c/c++ programmer)

-thomas blom in austin tx
From: us on
"Thomas " <thomas(a)ices.utexas.edu> wrote in message <i1jm7v$o2e$1(a)fred.mathworks.com>...
> Hello,
>
> I'm relatively new to Matlab, and trying to visualize the pdf of a 3-dimensional gaussian mixture model. I started with 3dim data, and fit this using gmdistribution.fit() to 3 components. So now I have a gmdistribution object which is the result of the fit.
>
> I manage to create a 3dim "grid" (using for loops, haven't mastered matlab matrix style yet) as a N x 3 matrix, and can get the pdf values for the N points with pdf( obj, pts) where obj is the gmm distribution and pts are my 3dim points.
>
> But how now to visualize this. I am imagining a plot in which the 3 dimensions give the cartesian coordinate, and the pdf value at that coordinate is indicated by either a shade of gray or a color, such that I see 'volumetric' rendering as a cloud of dots of different shades and/or transparency. It may also then be useful to project this into 2dims.
>
> Thanks for any tips - I've read isosurface, slice, etc, but these don't seem to be what I'm after, and alas am still struggling with matlab syntax. (I'm a c/c++ programmer)
>
> -thomas blom in austin tx

a hint:

help scatter3;

us