Binning 3D data und reasign Bin properties to data
4 ビュー (過去 30 日間)
Hey, following problem
I have following problem: I have 3D data from which I need to calculate properties.
To reduce the calculation time I want to bin the data, and then only calculate the properties of the bin-voxel that are populated and then reasign the calculated voxel properties to the data points that are within that specific bin.
Right now my sollution looks like this:
a5pre_val=(a5pre_edges(1:end-1) + a5pre_edges(2:end))/2;
a7pre_val=(a7pre_edges(1:end-1) + a7pre_edges(2:end))/2;
It works, but I am not sure if its the smartes way to do it. I also wrote it as a mex function with the coder, because i thought that functions like histcount and unique would be faste that way because I think those are the time critical functions, but it actually took twice as long...
I know of one more restriction:
initial data 0.9<composition(:,2) + composition(:,3) <1
But I am not sure how to include this in the histcount functions, because this would reduce the number of bins in which data points can be in and so make it faster.
Anybody has an idea how to improve it, or is this the way to go? Length of Compositions can be 200 but could also be 40k
EDIT: From the "Run and Time" function i know that a huge portion of that time is spend in the unique2012a function.
回答 (0 件)
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!