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

7 ビュー (過去 30 日間)
farzad
farzad 2020 年 4 月 6 日
コメント済み: farzad 2020 年 4 月 11 日
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 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 4 月 6 日
Can you elaborate what the filtering button does?
farzad
farzad 2020 年 4 月 6 日
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

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 7 日
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 件のコメント
farzad
farzad 2020 年 4 月 11 日
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 2020 年 4 月 11 日
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]

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by