How do I only take the first 1000 elements of a vector?
    100 次查看(过去 30 天)
  
       显示 更早的评论
    
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 个评论
采纳的回答
  Walter Roberson
      
      
 2019-10-13
         NameOfVariable(1:1000)
3 个评论
  Felix Mätzler
 2022-4-27
				
      编辑:Felix Mätzler
 2022-4-27
  
			I think something like this:
NameOfVariable(length(NameOfVariable) - 999 : length(NameOfVariable))
更多回答(0 个)
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
			
	产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




