How to add values to a vector?

Illustration
Brianna - 2020-11-19T11:17:34+00:00
Question: How to add values to a vector?

Hello! I have the values ??obtained from the matrix E = 1x11004, with some operations in the loop I need to remove the last values, can I do 1x11004 + 2 = 1x11006. My last values ??are 200 201 200 203, and I want to do 200 201 200 203 0 0

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

To add/ append
 
 
 
A = rand(1,10) ; 
B = zeros(1,2) ; 
iwant = [A B]
To Remove
 
 
A = rand(1,12)
A(11:12) = [] 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!