Storing for loop output that is a matrix 1 x 6387 each iteration in one matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Milton Logo
am 6 Dez. 2019
Kommentiert: Milton Logo
am 6 Dez. 2019
So lets say I run the for loop for two iterations the saved values will be a matrix 1 x 12,774.
n1 = 50; % Number of notes plotted
for i = 1:n1
xx2 = key2note(X,keynum(i),dur(i));
xs = [xx2(i)];
end
spectrogram(xs,'yaxis')
0 Kommentare
Akzeptierte Antwort
Ridwan Alam
am 6 Dez. 2019
I am assuming that you meant your xx2 has size 1x6387, and you want xs to be of size 1x12774 after two iteration.
n1 = 50; % Number of notes plotted
for i = 1:n1
xx2 = key2note(X,keynum(i),dur(i));
xs = [xs xx2];
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!