Exporting Structures Containing syms
Show older comments
How do I export the following fields with its corresponding values to a text or Excel file? I don't want to export each field manually since I am going to deal with larger structures later.

Note: all the values are numbers, but some of them are negative.
Thanks for helping!
Accepted Answer
More Answers (1)
Erik Huuki
on 9 Sep 2021
Edited: Erik Huuki
on 9 Sep 2021
Once you have a workspace you can save it as a mat file for later. Simply right click in the workspace and there should be an option for saving the workspace. Or you could put them all in a cell array as shown below and write to an xlsx file.
syms a b c
example = [string(a),string(b),string(c)];
writematrix(example,'example.xlsx')
Categories
Find more on Conversion Between Symbolic and Numeric 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!