Overload Char
This set of functions overloads horzcat([]), plus(+), and minus(-) for char types.
Using the builtin functions:
['a',98,'c'] -> 'abc'
'x'+1 -> 121
'x'-1 -> 119
Using the overloaded functions:
['a',98,'c'] -> 'a98c'
'x'+1 -> 'y'
'x'+ -1 -> 'w'
'x'-1 -> ''
'x'+'x' -> 'xx' %concatenate strings
'abc'-'b' -> 'ac' %removes token
'Hello World!' - 'World!' + 'Matlab!' -> 'Hello Matlab!'
To install, unzip somewhere and add the 'char_overloading' directory to your path. Do not add the '@char' directory to your path.
Installing does not enable this functionality until ToggleCharOverloading('on') is called.
Using ToggleCharOverloading from within functions does not work as intended. It is also written for Windows systems, but can be modified for Unix systems.
All functions are heavily documented, and lightly tested. It does not seem to break anything, but there is a possibility that something important may stop working or change its behavior.
Use at your own risk.
Zitieren als
Jon Danisch (2025). Overload Char (https://de.mathworks.com/matlabcentral/fileexchange/30194-overload-char), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
char_overload/
char_overload/@char/
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0.0 |
