I would like to shorten the code, but keep the same type and size of the variable N{t}{w}(i).
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
for t = 1:3
for w = 1:3
for i=1:10
N{t}{w}(i) = 0;
end
end
end
0 Kommentare
Antworten (1)
Walter Roberson
am 29 Mai 2023
Bearbeitet: Walter Roberson
am 29 Mai 2023
N = repmat({repmat({zeros(1,10)}, 1, 3)}, 1, 3)
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!