Hi. I have a value like a = 10101 this would change after how my program is run, but i will always use 0 or 1. so i consider this binary. now i would like to get the status of bit 5 i.e the first number (closest to the equal sign).
note!: the intention is to have the binary row decied which buttons are displayed in a gui.
this is what i have come up with
%code for i = 0:4 count = i+1 if (bitget(main_sel2, count)==1) set(handles.(sprintf('but%d', count))(:),'Visible','on'); else set(handles.(sprintf('but%d', count))(:),'Visible','off'); end end
No products are associated with this question.