How can I convert strings inside tables back to character arrays using convertContainedStringsToChars in MATLAB R2025b?
Show older comments
I am working in MATLAB R2025b and using modern features like string arrays and tables. However, I need to maintain compatibility with a legacy codebase that requires outputs as char arrays or cell arrays of characters.
I normally use the "convertContainedStringsToChars" function before passing data back to the legacy code. This works for cells and structs, but when I try to use it on a table that contains string variables, the function does not convert the strings back to char arrays.
Reproduction steps:
>> expected_output = table({'one'; 'two'})
>> string_table = table(["one"; "two"])
>> char_table = convertContainedStringsToChars(string_table)
The output:

What is the cause of this issue?
Is there a way to make "convertContainedStringsToChars" handle tables recursively, or is there a recommended workaround to achieve this conversion?
Accepted Answer
More Answers (0)
Categories
Find more on Structures 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!