How do I obtain size data from multi loaded text files?
Show older comments
I'm loading up a pair of text files (from the working directory) containing numerical data with the following code;
files = dir('*.txt');
for i=1:length(files)
eval(['load ' files(i).name ' -ascii']);
end
Is there a way to obtain the size dimensions (for each text file) using this approach within the for loop?
Accepted Answer
More Answers (1)
files = dir('*.txt');
for i=1:length(files)
eval(['load ' files(i).name ' -ascii']);
No need for eval here, just write
load file(i).name '-ascii';
As to the question, depends on what you mean by size as to how.
files(i).bytes
contains the disk storage of the file, the size function returns the size of the arrays in Matlab storage. There's also
doc whos % not optional parameters for various uses
I don't understand the question title of "multi-loaded" text files?
Categories
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!