writevar

Read an array or structure and create a script that can recreate it.

You are now following this Submission

This utility saves the contents of an array, structure, or array of structures in human-readable form to a text file in the form of a sequence of assignment statements. The intent is to create an "init" file that can be read or modified by users, for maintenance of large complex data structures.
There are three functions: writearray, writestruct, and writevar. Writearray works specifically on non-structure arrays or scalars, writestruct does a hierarchical descent of a structure, and writevar takes either structure or array input.

Cite As

Randy Poe (2026). writevar (https://www.mathworks.com/matlabcentral/fileexchange/989-writevar), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0