Hello,
I want to chance the background color of an uitable element with set -> 'BackgroundColor' within the function callback or from other functions.
However, the set command appears to be triggering the table callback. At least the callback runs 2 times if i click into the table, the second time with an empty event element.
Can somoene tell me what I am doing wrong?
Here is the code for changing the BackgroundColor from within the callback:
h_table1 = uitable(gcf,...
'Units', 'normalized',...
'position', [0.2,0.2,0.6,0.6],...
'CellSelectionCallback', {@test_callback}...
function test_callback(src,event)
table_height=height(src.Data);
color_matrix_ci = [repmat([1, 1, 1], row-1, 1); [1, 0, 0]; repmat([1, 1, 1], table_height-row, 1)];
set(src, 'BackgroundColor',color_matrix_ci) ;