Rank: 1566 based on 38 downloads (last 30 days) and 1 file submitted
photo

Massimo Ciacci

E-mail

Personal Profile:
Professional Interests:
Signal processing

 

Watch this Author's files

 

Files Posted by Massimo
Updated   File Tags Downloads
(last 30 days)
Comments Rating
11 Jul 2013 Screenshot line_fewer_markers An alias of the LINE command, with additional control for markers, in number and location. Author: Massimo Ciacci demo, gui 38 0
Comments and Ratings by Massimo View all
Updated File Comments Rating
06 Oct 2012 Fast interpolation Performs nearest-neighbor or linear interpolation much faster than interp1 when an evenly-spaced lib Author: Nathaniel Brahms

I liked this function in terms of speed, especially for large sized xi. However I found two shortcomings, which i explain in these examples:

Shortcoming 1:
--------------
Yi = qinterp1([14,15,16],[10 38 40],[17])

??? Error using ==> times
Matrix dimensions must agree.

Shortcoming 2:
--------------
>> Yi = qinterp1([3,15,16],[10 38 40],[2 3 14 15.5 16 17])

Yi =

NaN
10.0000
35.6667
38.0833
38.1667
38.3333

whereas the correct result should have been

>> Yi = interp1([3,15,16],[10 38 40],[2 3 14 15.5 16 17])

Yi =
NaN 10.0000 35.6667 39.0000 40.0000 NaN

The problem lies in the fact that the function assumes uniform spacing in the input x, which can be checked adding this extra check:

if sum(diff(diff(x)))
error('this function assumes uniform x spacing!');
end

03 Mar 2012 Add top X-axis with different scale Add an X-axis on top (additional to the one on bottom) of the figure, with its own ticks labels ... Author: Emmanuel Dinnat

After checking other solutions out there, this is by far the best and simple too, without complicate callback mechanisms to regenerate the labels on the secondary axis, which still zooms properly.

I had tried

set(gca, 'XTickMode', 'auto', 'XTickLabelMode', 'auto')

in the hope that labels would be updated automatically, but as a result the secondary axis becomes identical to the first!

Workaround, use manual xticks to start with, dense enough, before calling the function. But at least the new axis zooms properly! Well done Emmanuel!

03 Mar 2012 Add top X-axis with different scale Add an X-axis on top (additional to the one on bottom) of the figure, with its own ticks labels ... Author: Emmanuel Dinnat

It's a pity that after the second axis is drawn the xticklabels are frozen, so if one zooms in, new labels are not generated...

Top Tags Applied by Massimo
demo, gui
Files Tagged by Massimo
Updated   File Tags Downloads
(last 30 days)
Comments Rating
11 Jul 2013 Screenshot line_fewer_markers An alias of the LINE command, with additional control for markers, in number and location. Author: Massimo Ciacci demo, gui 38 0

Contact us