Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Index matrix to sparse matrix... saving memory
Date: Sun, 30 May 2010 12:02:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 12
Message-ID: <httk3s$hb0$1@fred.mathworks.com>
References: <htrfev$fo7$1@fred.mathworks.com> <htrk32$2vm$1@fred.mathworks.com> <htrlad$in3$1@fred.mathworks.com> <htrmbl$nn6$1@fred.mathworks.com> <hts2hl$3tk$1@fred.mathworks.com> <htt9rq$1s8$1@fred.mathworks.com> <htthum$sg$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1275220924 17760 172.30.248.37 (30 May 2010 12:02:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 30 May 2010 12:02:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:640659

"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <htthum$sg$1@fred.mathworks.com>...

> 
> Bruno,
> 
> I had downloaded your histcn function at one point to try and understand how it could be applied to my problem, but I must not fully understand it's abilities.  To me, I would think you would need to work from the edge of a matrix to use the HISTC and HISTCN functions.  Starting from an arbitrary point (r=0 in the above case could be in the center of the matrix), I don't understand how the function could be used to bin evenly spaced cartesian 3d space into bins defined by their spherical transforms?

If problem address in this thread needs can be solved with the built-in function HISTC (one dimensional binning). You have to understand how it works. The way you are using FIND for the same purpose is very inefficient.

The HISTCN I showed in other thread is an extension of HISTC. You don't need it here. And in the other thread I showed you the code that gives the rigorously identical result that with the double/triple for-loops in the first post. It seems you are trying to visualize what HISTN does in term of geometry, and it gets you lost in the way. Think in a more abstract way of mapping and you'll be fine.

Bruno