//A Marix A = [ 10 5 2 56.1385 2 10 5 61.8331 5 10 17 46.2755 10 17 5 70.5242 5 17 30 66.5410 30 5 17 86.5961] b = [10 2] //Copy A to C C=A // interchange row 1 and row 2 of C // you can interchange anything in C using A // you kept the original matrix A unchanged. C(1,:)=A(2,:) C(2,:)=A(1,:) // Setting row 1 and 2 to zero C(1:2,:)=0 // Deleting row 1 and 2 of C C(1:2,:)=[] //adding a number in a row vector //copy b to v v=b v=[v,5] //another approach //copy b to v v=b v(3,1)=5 v=b v(1,3)=5 //If you know the location of element to be added