Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Need some improvement in the plotting values

2 visualizaciones (últimos 30 días)
Stefan
Stefan el 5 de Dic. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello, I made this
for i=1:500:4500
if (i<3900)
k1=a(i:i+499,1);
fignum = figure('Units', 'norm', 'Position', [.2 .2 .7 .7],'name','Simple Pulse Meter');
thisax = axes('Units', 'norm', 'Position',[0.1 0.2 0.8 0.5]);
box1 = uicontrol('Style', 'text', 'Units', 'norm', 'Position', [.3 .8 .15 .05], 'String', 'Pulsescounted','fontsize',15);
box2 = uicontrol('Style', 'text', 'Units', 'norm', 'Position', [.45 .8 .15 .05]);
plot(k1,'-r','Parent', thisax);
set(box2, 'string', sprintf('%d', peaks),'fontsize',15);
drawnow();
else
break;
end;
end;
and I am getting evrything as I need but the plots are being displayed in different figures like first 500 values are being displayed in one figure and next 500 in another figure and so on.
1)How to make the current 500 values plot to display in a single figure clearing the previous plot.
2)Also need another method of plotting like 1000 values in a figure instaed of every 500 values plot and if new 1000 values are available then plot them on the same figure clearing the previous plot.
can anyone help me out in solving the issue. Thanks.

Respuestas (1)

sixwwwwww
sixwwwwww el 5 de Dic. de 2013
Dear Stefan, try this:
count = 1;
k2 = 0;
for i=1:500:4500
if (i<3900)
k1 = a(i:i+499,1);
if mod(count, 2) == 0
k2 = [k2, k1];
cla
% fignum = figure('Units', 'norm', 'Position', [.2 .2 .7 .7],'name','Simple Pulse Meter');
thisax = axes('Units', 'norm', 'Position',[0.1 0.2 0.8 0.5]);
box1 = uicontrol('Style', 'text', 'Units', 'norm', 'Position', [.3 .8 .15 .05], 'String', 'Pulsescounted','fontsize',15);
box2 = uicontrol('Style', 'text', 'Units', 'norm', 'Position', [.45 .8 .15 .05]);
plot(k2,'-r','Parent', thisax);
set(box2, 'string', sprintf('%d', peaks),'fontsize',15);
drawnow();
k2 = 0;
else
k2 = [k2, k1];
end
else
break;
end;
count = count + 1;
end

La pregunta está cerrada.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by