MATLAB: Subtract numbers in the row rowsubtract I have a row of different numbers like x=[12; 15; 19; 29; 37; 58…] how can I better subtract one number from the other like 15-12, 19-15, 29-19….? Best Answer diff(x) Related SolutionsMATLAB: Matlab row subtraction of matrix On the other hand, maybe you want to subtract row 2 from all the rows. In that case, you can do this.>> AA = 1 2 3 4 11 12 13 14 22 23 24 25 42 43 44 45>> AsubRow2 = A - A(2,:)AsubRow2 = -10 -10 -10 -10 0 0 0 0 11 11 11 11 31 31 31 31 MATLAB: Howe can I subtract neighboring numbers diff(z)z/60 Related QuestionConvert string to number or arraySubtract row from previous rowHow to subtract two close numbersSubtracting numbers from a date serialReshape an array into anotherSubtracting two numbers gives 0 as answer
Best Answer