I want to compare two matrixes and produce result as follows, if A=[5 10 15 20 22 24 26 30 34] in A first 4 element increased by 5 till 20 and next element from 20 to 26 increased by 2 and the rest is increased by 4 when only the incremants changes compare to previous I need to recalculate it by making it orgin. B=[1 1.5 2 4 5 8 14 17 25 18 16 22 23 20 27 29 32 34]; and the recalculation has to be happened only during the differnce between the element changes at A matrix. answer C=[1 1.5 2 4 5 8 14 17 3 18 16 2 3 17 1 20 1 2 6 8]. could it be compared and done. I tried some ways but it is not working as I expected
MATLAB: Comparing 2 matrixes A and B and reassigning values in 2nd matrix B based on the first matrix A
comparison
Best Answer