storing values in matrix
Mostrar comentarios más antiguos
I have a script wherein I have two nested for loops. The first for loop goes into a series of five directories. The second for loop goes into files within the directories and performs a series of analyses on waveforms. I'm trying to store certain values each time the script makes a loop through one directory. There's something wrong with my syntax obviously because instead of creating a new column for each directory its just adding onto the column the new values for the subsequent directories. I'm having difficulties getting it to start a new column when it stores. Any help would be much appreciated! Here's an example of a value I'm wanting to store:
keep2=[]
for i=1:length(dirs)
for pp=1:length(files)
keep(:,pp)=(snr510(:,pp)>1)&(snr1015>1)&(snr1520)>1;
keep2=[keep2;keep(:,pp];
end
end
Again instead of storing the values each time I move through the loop into a new column it just adds onto keep2.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!