Effacer les filtres
Effacer les filtres

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

80 vues (au cours des 30 derniers jours)
Rabeya
Rabeya le 21 Avr 2012
Without using a for loop, how can I generate an index 1,2,3,...,n?

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (1)

Arsal noor
Arsal noor le 22 Oct 2020
X = [1 2 3 4]

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by