File Exchange

image thumbnail

Loader of a .txt file to a MATLAB matrix

version 1.1.0.0 (10 KB) by Luka
Loads a content of a .txt file and stores it in a MATLAB matrix

0 Downloads

Updated 03 Jun 2011

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

Cite As

Luka (2020). Loader of a .txt file to a MATLAB matrix (https://www.mathworks.com/matlabcentral/fileexchange/31637-loader-of-a-txt-file-to-a-matlab-matrix), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Andres

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

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

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.0.0

Updated description of the file

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux