How to filter a signal(s) open in a UIAXES in matlab app designer?

4 visualizaciones (últimos 30 días)
Hi All
I have a listbox from which I choose some signal names and plot them on my UIAXES. now wanted to make a filter button. how could I transfer those signals to the filtering button ?
maybe assuming I have 3 signals already plotted
  2 comentarios
Ameer Hamza
Ameer Hamza el 6 de Abr. de 2020
Can you elaborate what the filtering button does?
farzad
farzad el 6 de Abr. de 2020
well, as you remember, I click on some filenames and I also have put a hold on button that I can hold the plots when being plotted on the UIAXES. once this is done and I have 3 plots present in the UIAXES, I want to press the filter button, with some defined variables let's say this one , get the plotted signals' variables : x-t and (then filter the x to y)
and plot the filtered signal over the same UIAXES

Iniciar sesión para comentar.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 7 de Abr. de 2020
Please check the attached file. It gives a general idea of how to apply a filter on the current line plotted on a UIAxes. You can modify it according to your requirements.
  37 comentarios
farzad
farzad el 11 de Abr. de 2020
Another problem : new : Using the plot children, I tried to plot the acceleration, but this plots nothing , why ?
app.Yd = [];
app.Xt = [];
for i=1:numel(app.UIAxes.Children)
% if strcmp(app.UIAxes.Children(i).Tag, 'uf1')
i;
app.Yd = [app.Yd; app.UIAxes.Children(i).YData];
app.Xt = [app.Xt; app.UIAxes.Children(i).XData];
% end
end
tf= app.Xt.'; %satri be sotuni
yf=app.Yd.';
dyf=gradient(yf)./gradient(tf);
ddyf=gradient(dyf)./gradient(tf);
cla(app.UIAxes)
drawnow;
pa1=plot(app.UIAxes, tf(:,1), ddyf(:,1))
pa1.Tag = 'acc1'; % unfiltered
hold(app.UIAxes,'on');
farzad
farzad el 11 de Abr. de 2020
pa1has data but nothing is drawn
pa1 =
Line with properties:
Color: [0 0.4470 0.7410]
LineStyle: '-'
LineWidth: 0.5000
Marker: 'none'
MarkerSize: 6
MarkerFaceColor: 'none'
XData: [1×15360 double]
YData: [1×15360 double]
ZData: [1×0 double]

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by