File Exchange

image thumbnail

Loader of a .txt file to a MATLAB matrix

version 1.1 (10 KB) by

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

2 Downloads

Updated

View License

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')

Comments and Ratings (5)

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

Luka

Luka (view profile)

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

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.

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.

Andreas

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

Updates

1.1

Updated description of the file

MATLAB Release
MATLAB 7 (R14)

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

» Watch video