Cody

# Shlomo Geva

Rank
Badges
##### 180
Score
1 – 38 of 38
 Shlomo Geva submitted a Comment to Solution 2064693 This solution actually fails on the assertion when using the following test (my own). It happens because of computational precision produced from using linspace() // out by about 0.222 * 1.0e-15. s = { ... 'Day Temp' ' 1 1.3' ' 5 9999' ' 6 9999' ' 5 9999' ' 6 9999' ' 2 1.12' ' 3 17' ' 4 16' ' 5 9999' ' 6 9999' ' 7 19'}; t_correct = [1.3 1.264 1.228 1.1920 1.156 1.12 17 16 17 18 19]; assert(isequal(read_and_interp(s),t_correct)); on 20 Dec 2019 on 20 Dec 2019 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 5 Nov 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 Shlomo Geva submitted a Comment to Solution 1319034 1. This solution is much faster on re-invocation than the one without the persistent num_ones variable. Unless of course it is performed on a much larger (than num_ones) array of 32-bit integer. 2. It is essential to have the statement x= double(x); The reason for this is that the floor() function has a problem with precision. If can fail with 32-bit integer that are close to 2^32. For instance, consider this Matlab code and system response: >> p=uint32(4294946031) p = uint32 4294946031 >> floor(p/65536) ans = uint32 65536 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 on 29 Oct 2017 Shlomo Geva received Commenter badge for Solution 1310820 on 23 Oct 2017 Shlomo Geva submitted a Comment to Solution 1310820 This is a correct solution - alas using a function handle, not an m-file on 23 Oct 2017 on 23 Oct 2017 Shlomo Geva received Solver badge for Solution 1111147 on 27 Jan 2017 on 27 Jan 2017
1 – 38 of 38