How to read and plot the value against time till the condition if false

1 次查看(过去 30 天)
I'd like to read and plot the value T continuously in time (time counts 1 s) until the radio button will be disabled. Also necessary display the value T graph. Problems: 1 - loop doesn't stop if I disabled the radio button 2 - plot function refresh the screen each iteration and I don't see previous values. %
function insens_Callback(hObject, eventdata, handles) % the function for my radio button: if enabled, then 'value'=1, disabled -- 'value'=0;
x=1; while get(handles.insens, 'Value')==1 % so the loop continues until the disabling of the radio button
[T] = julabo_getinttemperature(s); % reading of the T sensor plot (x,T) pause(1); x=x+1; end %
Would be grateful for your help.

回答(1 个)

Ingrid
Ingrid 2015-6-12
it seems strange to do this with a radiobutton instead of a stop pushbutton
you should check if the interruptibility of your radiobutton is set to on (standard it is off)
also use the hold on command so that the previously plotted points do not disappear when you call plot again

类别

Help CenterFile Exchange 中查找有关 Data Exploration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by