1.0
1.0 | 1 rating Rate this file 15 Downloads (last 30 days) File Size: 10 KB File ID: #31637 Version: 1.1
image thumbnail

Loader of a .txt file to a MATLAB matrix

by

Luka (view profile)

 

01 Jun 2011 (Updated )

Loads a content of a .txt file and stores it in a MATLAB matrix

| Watch this File

File Information
Description

I have found the functionality of being able to read data from a .txt file and storing them in a MATLAB matrix as quite useful and needed.

Example application: imagine you having some data stored in a .txt file (from some measurements) and you want additionally to process them, visualize or just save. This code does that.

This code is very similar to what load does. But, in this case one is able to add a bit customized functionality to my code to suit their specific needs.

Note: It assumes existence of only numeric data in a .txt file.

Example use:
MATRIX = txt2mat('data000.txt')

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
06 Jun 2011 Andres

Andres (view profile)

Hi Luka,
welcome to the file exchange -- however there is already a submission called "txt2mat", http://www.mathworks.com/matlabcentral/fileexchange/18430-txt2mat . Would you please consider renaming (just) your .m-file? I think some users might get confused when they search the file exchange for txt2mat, especially since both files are to serve a similar purpose.
Kind regards
Andres

Comment only
03 Jun 2011 Luka

Luka (view profile)

I gave you a framework, use it as you wish.

Comment only
03 Jun 2011 Bjorn Gustavsson

Luka, twice you've said "one is able to add a bit customized functionality" - it would be more informative if you gave some example of what extra functionality you provide.

Comment only
03 Jun 2011 Luka

Luka (view profile)

Yes, in deed. But in this case one is able to add a bit customized functionality to my code to suit their specific needs.

Comment only
03 Jun 2011 Andreas

Same like matlab-own "load" function.
abc = load('data000.txt');

Updates
03 Jun 2011 1.1

Updated description of the file

Contact us