Any way to use British spellings for function calls and arguments?
2 次查看(过去 30 天)
显示 更早的评论
This is really a very minor gripe, but the amount of times I'll be typing out several lines of code or several subplots and run into a wall of errors because of American spellings is pretty substantial (muscle memory takes over).
R accepts both the English and Americanised spellings of words. Is there any way I can have MATLAB accept the English (e.g. 'Grey', not 'Gray'; and 'Colour', not 'Color', etc.) spellings for functions and arguments?
Cheers! No problem if not, like I said as a Brit muscle memory tends to take over and I end up with an error.
0 个评论
回答(3 个)
Adam
2019-10-25
编辑:Adam
2019-10-25
I took this seriously at first and was appalled! Not because I think it is 'wrong', but because I have taken advantage of Matlab's inability to spell correctly on numerous occasions by writing my own functions or variables with correctly spelled names like colourmap. Had this been implemented it would have caused all manner of clashes in my code.
But yeah, in case you didn't notice, check the date of the blog post!! I even read it on the day it came out and still didn't twig immediately!
0 个评论
Matt J
2019-10-25
You can certainly write your own function aliases, as for example,
function varargout=rgb2grey(varargin)
[varargout{1:nargout}]=rgb2gray(varargin{:});
end
0 个评论
Steven Lord
2019-10-25
Tab completion may be able to help you out, if you train your muscle memory to include the Tab key as part of your normal typing workflow. Typing "rgb2" then pressing Tab lists three possible completions; "rgb2g" [Tab] completes rgb2gray as that's an unambiguous completion. This works in the Command Window, the Editor, and the Live Editor.
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!