Clear Filters
Clear Filters

Why is ascii2str not recognized in 2022a?

10 views (last 30 days)
Daryl Lee
Daryl Lee on 13 Aug 2022
Commented: Daryl Lee on 13 Aug 2022
This clip fom the command window summarizes my question. I hav a new install of MATLAB 2022a on MacOS 12.4. Has something changed?
>> bytes = [0x57 0x58 0x53 0x54]
bytes =
1×4 uint8 row vector
87 88 83 84
>> str = ascii2str(bytes)
Unrecognized function or variable 'ascii2str'.
>>>> ver
MATLAB Version: (R2022a) Update 4
MATLAB License Number: 707564
Operating System: macOS Version: 12.4 Build: 21F79
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Version 9.12 (R2022a)
Fuzzy Logic Toolbox Version 2.9 (R2022a)
Statistics and Machine Learning Toolbox Version 12.3 (R2022a)
Symbolic Math Toolbox

Answers (1)

Steven Lord
Steven Lord on 13 Aug 2022
According to the documentation "The operator ascii2str is supported only in Stateflow® charts that use C as the action language."
In MATLAB the equivalent is the char function.
bytes = [0x57 0x58 0x53 0x54]
bytes = 1×4
87 88 83 84
c = char(bytes)
c = 'WXST'


Find more on Debugging and Analysis in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!