Store arrays of different size in each for loop itertaion
Ältere Kommentare anzeigen
Hi,
In the below script, I need to store the output kkkk into a new array but in the same column. Here, size of the kkkk is different during each itertaion.
I know that cell array would solve the issue. But I need to store them in the single colum.
for i=1:4
kkkk = find(A>=sz(i,1) & A<=sz(i,1)+100);
clear kkkk
end
1 Kommentar
James Tursa
am 10 Apr. 2024
Can you show a small example of inputs and desired output?
Akzeptierte Antwort
Weitere Antworten (1)
b=sparse(sz(:,1)');
kkkk = nonzeros( (A(:)>=b & A(:)<=b+100).*(1:numel(A))' );
1 Kommentar
Turbulence Analysis
am 11 Apr. 2024
Bearbeitet: Matt J
am 11 Apr. 2024
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!