Creating a vector with a pattern of numbers

Hello,
I want to create a vector with numbers that follow this pattern:
1 4 5 6 7 10 11 12 13 16 17 18 19 22 23 24 25 28 29 30 31 ... with a given maximum number m. Anyone has an idea how to do that ?

 Respuesta aceptada

darova
darova el 4 de Mayo de 2020
Try this pattern
a1 = [1 3 1 1];
use repmat and cumsum

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 4 de Mayo de 2020

Comentada:

el 4 de Mayo de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by