You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Create a new type called STR with a character array inside, implemented as a structure. It was inspired in Visual Basic syntax.
It was implemented several operators and functions overloads, but allows any character array function using "char" conversor function or ' transpose overload.
It's necessary to create a folder from a MatLab folder in one of the MatLab paths. The folder name is class name, with @ prefix. The .m name is class name.
Operator Overload: ==,~=,<=,>=,>,< -,*,/,\,', [], +,-, (), |
Function Overload: disp, length, upper, lower, strfind
Other Functions: str, left, right, mid, padl,padr, padc, instr, repeat, replace, trim, ltrim, rtrim
Example
=======
s1=str('play');
s1-'l'+ ' t' + 'cricket' - 'cr'
ans=
pay ticket
More details in the start of str.m file and before each function.
Cite As
Paulo Buchsbaum (2026). Class for character array (https://www.mathworks.com/matlabcentral/fileexchange/28928-class-for-character-array), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.3.0.0 (7.09 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.3.0.0 | Minor bugs correction. Improving functions. Adding ', |, - operator overloading. |
||
| 1.2.0.0 | Minor bug corrections, Improves heuristics and introduces new *, / and \ operators. |
||
| 1.1.0.0 | Minor bug corrections and left assignment for Str |
||
| 1.0.0.0 |
