How to add values to a vector?

B
Brianna · Nov 19, 2020 · 1.9K views
Question
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 PhD Expert
Answered Aug 24, 2026
To add/ append
 
 
 
A = rand(1,10) ; 
B = zeros(1,2) ; 
iwant = [A B]
To Remove
 
 
A = rand(1,12)
A(11:12) = [] 
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!