Case sensitive feature fails
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
version: MATLAB R2018a
surf(peaks)
>> colormap BlueDarkOrange18
Error using feval
Cannot find an exact (case-sensitive) match for 'bluedarkorange18'
The closest match is: BlueDarkOrange18 in /usr/local/MATLAB/R2018a/toolbox/matlab/ncl_rgb/BlueDarkOrange18.m
Error in colormap (line 91)
arg = feval(arg);
My question is that, what I typed is 'BlueDarkOrange18', the error hints translated it into 'bluedarkorange18', this operation doesn't make sense.
6 Kommentare
Steven Lord
am 29 Jul. 2019
There is another alternative than changing the case of the function that defines your new colormap, and that is to change how you call colormap. The colormap function can accept the name of a colormap or an M-by-3 matrix that defines the colormap. Instead of calling colormap like this:
colormap BlueDarkOrange18
call it like this:
colormap(BlueDarkOrange18)
To support this, the BlueDarkOrange function should handle being called with either 0 or 1 inputs. With 0 inputs, it should return a matrix with a number of rows equal to the number of rows in the current figure's Colormap or the number of rows in the default colormap if there is no figure open. See the block of code at the start of the parula function for an example of how to obtain this information. With 1 input, if that input is a nonnegative scalar integer value it should return a colormap with that many rows.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Colormaps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!