GUI red circle indicating connection
3 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Baltam
2016-4-19
Personally I would do it with axes yes. Below an example of green and red circle depending on parameter x.
x = [0 1];
for i =1:numel(x)
rectangle('Position', [0.0 0.0 1 1], 'Curvature', [1 1], 'FaceColor', [x(i) 1-x(i) 0]) % with x = parameter
ax = gca;
% remove tick labels
set(ax,'XTick',[]),set(ax,'YTick',[])
% make lines of the axes white --> invisible on white background
set(ax,'XColor',[1,1,1]) , set(ax,'YColor',[1,1,1])
% make axes square to get round circle
axis square
pause(0.5)
end
Kind regards,
Baltam
4 个评论
Baltam
2016-4-21
编辑:Baltam
2016-4-21
I believe you need something like this and adjust the function to make it change the color of the circle to white. I never used it before so good luck. I also read if you are doing heavy caculations the timer will not do its function in the background but it will do its task whenever some time is available.
t = timer;
t.ExecutionMode = 'fixedRate';
t.Period = 1;
t.TimerFcn = @(~,~)disp('1s elapsed');
start(t)
Good luck,
Baltam
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!