file2str

converts a text file into a cell array
1.8K Downloads
Updated 10 Jul 2006

View License

file2str Reads a text file into a cell array of strings

Input:
* file ... name of the file, i.e. file = 'test.txt'

Output:
* str ... cell array of strings
* fullPath ... path + filename + extension
* file ... filename
* directory ... path to file

Example
Write cell array to textfile.
+ str2file( {'aa','bbbb','','cc'}, 'test.txt' );
Read the text file with
+ t = file2str( 'test.txt' )

See also: str2file

Cite As

Wolfgang Garn (2026). file2str (https://se.mathworks.com/matlabcentral/fileexchange/11667-file2str), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP2
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0