View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

5.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 1.88 KB File ID: #35404 Version: 1.0



Mark Mikofski (view profile)


Create a set of objects from a text file.

| Watch this File

File Information

MDC = MYDYNAMICCLASS(TEXTFILE) will create a set of class from TEXTFILE.

The file must be delimited by white spaces so for text use underscores. Do not use quotes anywhere.

The first line should begin with the Class name followed by a list of the Fields.

Each subsequent line should begin with the Member followed by the values for each of the Fields.

myDynamicClass will convert strings to numbers; and may read in arrays if they entered as strings and use commas instead of spaces.

MDC = MYDYNAMICCLASS(TEXTFILE,FORMAT) creates the file using a FORMAT string that conforms to the standard MATLAB textscan notation.

Required Products MATLAB
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
17 Oct 2013 Zoe

Zoe (view profile)

02 Mar 2012 Mark Mikofski

Mark Mikofski (view profile)

Using JSON is a more standardized way to convert text and text files to structures (or objects). XML is of course another standard and it is built into MATLAB, but it can be more effort than parsing JSON,
Here is a MATLAB JSON parser By Q Fang:
Also see these JSON references:
Here are some XML references:

Comment only

Contact us