how to repeat [5,4,3,2,1.....] infinitely?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
how could I?
can someone give me a code?
1 Kommentar
Rik
am 31 Mär. 2022
Your computer does not have infinite memory. What exactly did you intend to do with this infinite vector?
Antworten (1)
Bruno Luong
am 31 Mär. 2022
Bearbeitet: Bruno Luong
am 31 Mär. 2022
A meta-array:
x = rep5to1(100:120)
%%
function x = rep5to1(i)
a=5:-1:1;
x = a(mod(i-1,length(a))+1);
end
0 Kommentare
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays 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!