How to load same/common variables from multiple file without overwriting the previous values
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
TRISHITA BANERJEE
le 25 Avr 2018
Réponse apportée : TRISHITA BANERJEE
le 27 Avr 2018
I have three sudio files and each have the same variables('measuredSystem_L','measuredSystem_R').I want to store the values of the variables in same matrix without the previous value being overwritten.I will state the situation.
I have written a code for this script but the previous values are getting overwritten.How can I keep such a script where all the values of the same variables are stored respective to the audiofile. My code:
matfiles=dir('*audiointerface*.mat');
N=length(matfiles);
filenames=cell(N,1);
for i=1:N
filenames{i}=matfiles.name; data=load(matfiles(i).name);
end
0 commentaires
Réponse acceptée
Stephen23
le 25 Avr 2018
Use a cell array and indexing:
data = cell(N,1);
for k = 1:N
data{k} = load(matfiles(k).name);
end
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!