Code covered by the BSD License  

Highlights from
txt2struct.m

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 6.7 KB File ID: #46971

txt2struct.m

by

 

16 Jun 2014 (Updated )

read a text file and store in a matlab structure.

| Watch this File

File Information
Description

Read delimited text file directly into a matlab structure with fields based on the header line text. Datatype for each field is determined by analyzing the first line of data. If datatype of a field changes then data for entire column is stored in a cell.
Enable quick input of data and easy access via the matlab structure.

[output_structure] = txt2struct(textfile, varargin)

example

mystruct = txt2struct('testdata.csv');

% Author:
% Tim Ryan CSIRO 18 Dec 2007
% Revised:
% Gordon Keith CSIRO 12 Sep 2013

Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us