How do I obtain size data from multi loaded text files?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (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?
1 commentaire
Brad
le 10 Juin 2014
Catégories
En savoir plus sur Entering Commands dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!