Why is ascii2str not recognized in 2022a?

12 次查看(过去 30 天)
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: 9.12.0.2009381 (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

回答(1 个)

Steven Lord
Steven Lord 2022-8-13
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'

类别

Help CenterFile Exchange 中查找有关 Debugging and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by