Code covered by the BSD License  

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

» Watch video

Highlights from
struct2File

4.0
4.0 | 1 rating Rate this file 22 Downloads (last 30 days) File Size: 2.06 KB File ID: #35421 Version: 1.0

struct2File

by

 

Print a struct to file.

| Watch this File

File Information
Description

Print a struct to file. The output can be aligned to be more human-readable, or be separated by a specified delimiter.
Requires the getarg function.

Ex:
struct2File( s, 'c:\file.txt', 'align', true, 'sort', false );

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 (4)
07 Apr 2016 Sandra Gomes  
15 Jan 2016 maximus

this is great. you just saved me hours, thx.

Comment only
10 Nov 2014 sebastián

great

Comment only
22 Feb 2013 Ben

Ben (view profile)

It seems to do what it says. You'll need to download the other file:
http://www.mathworks.com/matlabcentral/fileexchange/35415

I was hoping for something that would work recursively for structs. EG:
>> s1 = struct('one',1,'two','two');
>> s2 = struct('field1',1.1,'field2','a string!');
>> s.s1 = s1;
>> s.s2 = s2;
>> struct2File( s, 'C:/test.txt')

It doesn't do what I was hoping it would, but it still works for simple structs.

Comment only

Contact us