How do I only take the first 1000 elements of a vector?
    96 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Anne Nguyen
 le 13 Oct 2019
  
    
    
    
    
    Commenté : Stephen23
      
      
 le 27 Avr 2022
            My task is to use the first 1000 elements in a vector. So how do I only take the first 1000 elements of a vector? I am new to MATLAB, so any help would be appreciated. I tried finding a source to read about how to do this, but could not find one. Thank you!
0 commentaires
Réponse acceptée
  Walter Roberson
      
      
 le 13 Oct 2019
         NameOfVariable(1:1000)
3 commentaires
  Felix Mätzler
 le 27 Avr 2022
				
      Modifié(e) : Felix Mätzler
 le 27 Avr 2022
  
			I think something like this:
NameOfVariable(length(NameOfVariable) - 999 : length(NameOfVariable))
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
			
	Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




