I recently updated MATLAB from R2016b to R2019b, and noticed my codes drawing figures do not work in the same way.
When I draw an image with a colorbar and set scaled CDataMapping, the image reflects scaled color scheme but the scales on the colorbar is not refreshed.
How I can make them refreshed every time I update CData of the image?
Below is my example in which colorbar scale is not refreshed.
read = zeros(4, 'uint16');
readcount = 0;
fig = figure;
img = image (read,'CDataMapping','scaled');
c = colorbar;
while 1 == 1
readcount = readcount + 1;
read(mod(readcount,16)+1) = read(mod(readcount,16)+1) + readcount;
img.CData = read;