Heatmap function does not work
Afficher commentaires plus anciens
Hey, I don't understand why the 'heatmap' function doesn't work for me (Matlab version 2015) when I see examples for that function written in Matlab version 2014.
I cannot find it in the documentation. Can somebody help?
8 commentaires
Adam
le 30 Mai 2017
What do you mean by 'doesn't work'? Error? Incorrect result?
Lidiya P
le 30 Mai 2017
Adam
le 30 Mai 2017
The version of heatmap that is in my Matlab was only introduced in R2017a. Are you sure the older examples aren't using a function of the same name from the Matlab File Exchange or some other source. Where are these examples from?
Lidiya P
le 30 Mai 2017
Lidiya P
le 30 Mai 2017
The best thing to do is use the documentation that is shipped with Matlab by typing
doc
or e.g.
doc heatmap
Using the online documentation is always tricky when you are using an old version because it will always be the latest version of the help (though you can dig out older versions of the help online, but why bother when you can use the one shipped with Matlab?).
However the latest versions of the help (I can't remember at which version it started, ironically!) always include a line at the bottom e.g.
'Introduced in R2013b'
so that you can see at a glance when a function was introduced. Changes to the syntax of functions is more difficult and is embedded in the release notes though.
For example plotting functions did not used to include a syntax that takes the axes to plot on as first argument. This was introduced to different functions across different versions and it isn't trivial to work out which version it was added in for a given function when answering questions in this forum suggesting to use it!
Steven Lord
le 30 Mai 2017
We started adding the note at the end of the function documentation pages indicating the release in which the function was added in release R2015a. I'm not sure all documentation pages (including pages for older functions) have it, but going forward I believe all new functions' documentation pages will have that note.
Lidiya P
le 30 Mai 2017
Réponses (1)
Benjamin Kraus
le 1 Juin 2017
4 votes
There are two reasons the HeatMap command may not work for you in R2015a/b.
- The HeatMap command comes with the Bioinformatics Toolbox. If you do not have the Bioinformatics Toolbox, you will not be able to use the built-in HeatMap command.
- If you have the Bioinformatics Toolbox, MATLAB is case sensitive, and the HeatMap command has a capital H and M, so make sure you are using a capital H and M.
Also note, starting in MATLAB R2017a there is a new heatmap command (all lowercase) that is available in MATLAB (without any toolboxes) in addition to the HeatMap command (from the Bioinformatics Toolbox).
Finally, if you cannot upgrade to MATLAB R2017a or get the Bioinformatics Toolbox, there is a very popular heatmap function available on the MATLAB File Exchange (called Customizable Heat Maps).
Catégories
En savoir plus sur Data Distribution Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!