Tutorial by Examples

The use of Matlab Coder sometimes denies the use of some very common functions, if they are not compatible to C++. Relatively often there exist undocumented helper functions, which can be used as replacements. Here is a comprehensive list of supported functions.. And following a collection of alte...
In MATLAB versions prior to R2014b, using the old HG1 graphics engine, it was not obvious how to create color coded 2D line plots. With the release of the new HG2 graphics engine arose a new undocumented feature introduced by Yair Altman: n = 100; x = linspace(-10,10,n); y = x.^2; p = plot(x,y,'r...
Since Matlab R2014b it is easily possible to achieve semi-transparent markers for line and scatter plots using undocumented features introduced by Yair Altman. The basic idea is to get the hidden handle of the markers and apply a value < 1 for the last value in the EdgeColorData to achieve the d...
When displaying labels on contours Matlab doesn't allow you to control the format of the numbers, for example to change to scientific notation. The individual text objects are normal text objects but how you get them is undocumented. You access them from the TextPrims property of the contour handl...
Existing legends can be difficult to manage. For example, if your plot has two lines, but only one of them has a legend entry and that should stay this way, then adding a third line with a legend entry can be difficult. Example: figure hold on fplot(@sin) fplot(@cos) legend sin % Add only a le...
The scatter function has two undocumented properties 'jitter' and 'jitterAmount' that allow to jitter the data on the x-axis only. This dates back to Matlab 7.1 (2005), and possibly earlier. To enable this feature set the 'jitter' property to 'on' and set the 'jitterAmount' property to the desired ...

Page 1 of 1