explain if ytick(i) == -10 yticklabel(i:i,1:3) = [num2str(ytick(i),'%3.0f)')]; in matlab

This code checks if the ith element of ytick vector is equal to -10. If it is, then it takes the ith element of yticklabel matrix and overwrites it with a string generated by num2str function applied to ytick(i) using format specifier '%3.0f'. This string is then concatenated with ')' symbol. Therefore, this code updates the yticklabel matrix with new values for the ith element, only if the ytick's value at ith position is -10.

related categories

gistlibby LogSnag