How to generate a sequence in MATLAB?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Let m be the size of a sequence, where m is even,
How to generate a sequence
A = [ 1 , m/2, m,
2, (m/2 -1), (m/2 +1), (m-1),
3, (m/2 -2), (m/2 +2), (m-2),
.....]
0 comentarios
Respuesta aceptada
KSSV
el 15 de Mzo. de 2022
Editada: KSSV
el 15 de Mzo. de 2022
m = 10 ;
n = 10 ; % decide till what number you want to end
C1 = (1:n)' ;
C2 = m/2-(0:n-1)' ;
C3 = [m ; m/2+(1:n-1)'] ;
A = [C1 C2 C3]
9 comentarios
Torsten
el 15 de Mzo. de 2022
It's KSSV's solution - only slightly adapted.
But thank you for asking.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!