MATLAB: Replace values at certain positions (positions given in an array, as well as new values)

replace

Hello, my problem is the following: I have a Matrix A with a lot of data and some values need to be replaced. I have two additional arrays, one which leads to the positions in A where the new value belongs, and one which contains the new value for the position in A. Can someone help me? Thanks in advance

Best Answer

A(B) = C;
should work if B are the locations and C the values, provided they are the same length and contain valid indices and all the usual constraints.