1

I am trying to use the matlab heatmap funciton as described in http://www.mathworks.com/matlabcentral/fileexchange/24253-customizable-heat-maps/content/html/heatmap_examples.html

However I am facing the following error even when I use their data i.e. spreads_small and labels_small:

    heatmap(spreads_small(1:5,1:7), labels_small(1,1:7), labels_small(1:5));

    ??? Subscript indices must either be real positive integers or logicals.
    Error in ==> heatmap>setAxesLabels at 280
    set(p.hAxes,'YTick',ytick,'YTickLabel',ylab(ytick));
    Error in ==> heatmap at 111
    [p, xlab, ylab, hXText] = setAxesLabels(p, xlab, ylab);

I don't know why this error is popping, I have been trying to use this heatmap for almost 2 hours without any success! Can please help me ASAP?

user654473
  • 13
  • 3
  • what are the values of `labels_small`? Try `dbstop if error` and then run the command. See in debugger what are the indices values. Use stack to trace them. – Shai Dec 23 '12 at 14:45
  • Check whether `any(labels_small==0)` or `any(spreads_small(:)==0)` returns true. – Jonas Dec 23 '12 at 16:27
  • 1
    Also see [this question](http://stackoverflow.com/questions/20054047/subscript-indices-must-either-be-real-positive-integers-or-logicals-generic-sol) for [the generic solution to this problem](http://stackoverflow.com/a/20054048/983722). – Dennis Jaheruddin Nov 27 '13 at 15:46

0 Answers0