How to update certain cell values without using for loop
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
Is there away to do these codes below without for loop to make it faster?
for x = 1:336
row{1,x}(p{1,x}(1:end)) = cellPix{1,x}(2:3:pMax(x)*3);
col{1,x}(p{1,x}(1:end)) = cellPix{1,x}(3:3:pMax(x)*3);
end
row,col,p, cellPix are cell arrays.
I appreciate for your help!
3 Kommentare
Walter Roberson
am 5 Apr. 2023
Is there a particular reason you are indexing p{1,x}(1:end) insted of just using p{1,x} ?
Antworten (1)
Matt J
am 5 Apr. 2023
Bearbeitet: Matt J
am 5 Apr. 2023
There is no way to iterate over cell or struct arrays, other than with an M-Coded for-loop, or something equivalent. The way to iterate faster over your particular data would have to involve reorganizing it into matrix form, rather than cells.
0 Kommentare
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!