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

1 visualización (últimos 30 días)
Bogdan
Bogdan el 12 de Jun. de 2015
Respondida: Ingrid el 12 de Jun. de 2015
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.

Respuestas (1)

Ingrid
Ingrid el 12 de Jun. de 2015
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

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by