Back to the main page.

Bug 3134 - ft_singleplotTFR 'ismatrix' function is missing

Status CLOSED FIXED
Reported 2016-05-30 18:23:00 +0200
Modified 2016-05-31 16:22:24 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Diego Lozano Soldevilla - 2016-05-30 18:23:40 +0200

I'm testing the time frequency tutorial and I got the following error due to the missing function "ismatrix.m" cfg = []; cfg.baseline = [-0.5 -0.1]; cfg.baselinetype = 'absolute'; cfg.maskstyle = 'saturation'; cfg.zlim = [-3e-27 3e-27]; cfg.channel = 'MRC15'; figure ft_singleplotTFR(cfg, TFRhann); ??? Undefined function or method 'ismatrix' for input arguments of type 'double'. Error in ==> rgb2hsv at 12 elseif ismatrix(m) && size(m,2)==3 Error in ==> ft_plot_matrix at 239 hsvcdat = rgb2hsv(rgbcdat); Error in ==> ft_singleplotTFR at 466 ft_plot_matrix(xvector, yvector, datamatrix, 'clim',[zmin,zmax],'tag','cip','highlightstyle',cfg.maskstyle,'highlight', mask) I was using a relatively old matlab (7.9.0.529 (R2009b)). Adding the ismatrix function from fileexchange would solve the issue: http://fr.mathworks.com/matlabcentral/fileexchange/26784-property-sheet/content/ismatrix.m


Jan-Mathijs Schoffelen - 2016-05-31 09:15:56 +0200

RELATIVELY OLD????!!! Ancient, you mean :o). Note, that issues of this kind are typically solved through the compat/matlabltX directories. I see that matlablt2010b (which would apply to your case) already has the isrow and iscolumn functions. Perhaps you could add the ismatrix there?


Robert Oostenveld - 2016-05-31 09:18:50 +0200

I indeed recall that functions like these have some historical issue. I think they were first in a (extra) toolbox and only later were moved to standard matlab. If you don't have that toolbox, then it fails. >> which isvector built-in (/opt/matlab/R2009a/toolbox/matlab/elmat/isvector) >> which ismatrix 'ismatrix' not found. >> which isrealmat /opt/matlab/R2009a/toolbox/ident/idutils/isrealmat.m ident = system identification toolbox, http://se.mathworks.com/help/ident/index.html I can check relatively easily on mentat whether these functions exist on all matlab versions. Will do. Then they should be added to the respective combat directories.


Diego Lozano Soldevilla - 2016-05-31 10:17:52 +0200

(In reply to Robert Oostenveld from comment #2) No worries Robert. Given I've a prehistoric matlab version doesn't make any sense to support it . I'll be aware and it's easy to solve. I close this bug but feel free to open it if you disagree


Robert Oostenveld - 2016-05-31 12:13:17 +0200

Since we now have a better way of dealing with old matlab version, I think it would be good to organize these functions in a better way. See also http://mailman.science.ru.nl/pipermail/fieldtrip/2012-May/005115.html which is slightly related. This is what we have at DCCN (up to 2015b) on the cluster: roboos@dccn-c023> ls /opt/matlab/*/toolbox/ident/idutils/isreal* /opt/matlab/R2007a/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2007a/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2007a/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2007b/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2007b/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2007b/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2008a/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2008a/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2008a/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2008b/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2008b/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2008b/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2009a/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2009a/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2009a/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2009b/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2009b/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2009b/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2010a/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2010a/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2010a/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2010b/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2010b/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2010b/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2011a/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2011a/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2011a/toolbox/ident/idutils/isrealvec.m /opt/matlab/R2011b/toolbox/ident/idutils/isrealmat.m /opt/matlab/R2011b/toolbox/ident/idutils/isrealrowvec.m /opt/matlab/R2011b/toolbox/ident/idutils/isrealvec.m Since these disappeared after 2011b, they should not be in external/ident. I will add is matrix to combat/matlablt2010b, which already contains some of these type of functions. roboos@mentat001> git commit [master 4dc111c] ENH - improved support for matlab2009b, see bug 3134 2 files changed, 35 insertions(+) create mode 100644 compat/matlablt2010b/ismatrix.m create mode 100644 test/test_bug3134.m


Diego Lozano Soldevilla - 2016-05-31 16:22:24 +0200

(In reply to Robert Oostenveld from comment #4) Cool! thanks Robert