New answers tagged


I see that you are doing some redundant computation, for example y.^2+z.^2 is computed 4 times, with y.^2 and z.^2 are computed 9-10 times. You can define a set of variables y2=y.^2, z2=y.^2, y2pz2=y2+z2; and push some of the computation cost to memory -given that you have enough memory. That would save you a good amount of time. MATLAB is a column-major ...


Have you tried arrayfun? If the arrays are really large (how large are we speaking, by the way?), it might be possible that allocating all those temporaries has a cost that arrayfun would save. Also, instead of concatenating, you could preallocate U and fill it one block at a time.


There is a very battle-tested library for this called fpzip, which has both lossless and lossy compression. There's a paper by the authors about their approach (here's a link without a paywall too). If you look at table 1 in their paper, they get compression ratios on the order of 100 for some simulation outputs, but as low as ~1.3 on others. Clearly the ...

Top 50 recent answers are included