How to export struct saved in workspace to text file
Show older comments
Hi, I have a struct with some fields inside. I want to be able to export the struct (or at least 2 of the fields inside) to a text file. Any help would be appreciated. Thanks
6 Comments
Walter Roberson
on 1 Aug 2022
What output format do you need ?
Have you considered Json encode?
ProgramNerd
on 1 Aug 2022
Walter Roberson
on 1 Aug 2022
json is a text file
ProgramNerd
on 1 Aug 2022
Walter Roberson
on 1 Aug 2022
see https://www.mathworks.com/help/matlab/ref/jsonencode.html#mw_69b38ba2-26d1-4025-a426-d1bf8ca939a7
ProgramNerd
on 1 Aug 2022
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!