Not really understanding why cdata isn't working
9 views (last 30 days)
This code I have is giving me an error saying cdata is not a recognizable function. If anyone could help me understand why, it would really be helpful please.
h = heatmap(cdata,'ColorLevels', 5);
h.XLabel = 'Longitude';
h.YLabel = 'Latitude';
Walter Roberson on 27 Jul 2022
heatmap can be called in two different ways.
If you call it with a 2d numeric array, then a map is constructed that is the same size as the array and the array values are relative intensities. This is the mode that your code is trying to use.
If, however, you have a table() object, then you can pass in the table and the names of two variables, and heatmap() will count all of the times that each combination of the two variables occurs and will create a heatmap of the results. This might be the form that you actually need.