Borrar filtros
Borrar filtros

generating a sequence 1,2,3,4,....,n

76 visualizaciones (últimos 30 días)
Rabeya
Rabeya el 21 de Abr. de 2012
Respondida: Arsal noor el 22 de Oct. de 2020
Without using a for loop, how can I generate an index 1,2,3,...,n?

Respuesta aceptada

R.U.F.
R.U.F. el 21 de Abr. de 2012
vector=[1:stepsize:n] if the stepsize =1 as in your case, you can disregard it
  1 comentario
Jan
Jan el 22 de Abr. de 2012
Following the mlint suggestion, you can omit the square brackets: "1:n"

Iniciar sesión para comentar.

Más respuestas (1)

Arsal noor
Arsal noor el 22 de Oct. de 2020
X = [1 2 3 4]

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by