how to save all output of a loop in a matrix. the loop run throug 200 files dataset and return column vector of 800 points each iteration , i need to have 200x800 matrix as result
    7 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
Risposte (1)
  nanren888
      
 il 7 Gen 2019
        
      Modificato: nanren888
      
 il 7 Gen 2019
  
      %
% Header explaining things, like purpose, author, date, purpose of homework?
%
% BTW: If you access the data by loop iteration, eg dataStore(k,:) you might want to consider transposing your dataStore.
%
filenameC = getFileNames();
nFile = length(filenameC);
nData = 200;
dataStore = zeros([nData,nFile]); % preallocate for speed
%
for kFile = 1:nFile
    dataStore(kFile,:) = myFunctionInvolvingFilename(filenameC{kFile});     # MUST return 800-long data, never empty
end
%
% Enjoy :)
%
0 Commenti
Vedere anche
Categorie
				Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

