フィルターのクリア

Error in plotting line and scatter in the same plot, for filtered data and original data

1 回表示 (過去 30 日間)
Kasih Ditaningtyas Sari Pratiwi
Kasih Ditaningtyas Sari Pratiwi 2017 年 10 月 25 日
回答済み: KSSV 2017 年 10 月 26 日
Hi! I have a problem in plotting my data. I have a table consist of date and value, let's call it respectively t and x. I have filtered x and got only several value out of x data (call it y1), for example I have 54 data in x, and I only have 9 data in y1. However, y1 is the part of x.
I want them to be plotted in the same graph, line for x data, and scatter for y1 data. They both should be plotted over t. Here is my code:
figure(3)
x=flowtable.Durchflusslm;
t=flowtable.DateAndTime;
pf=peakflow;
y1=filter(pf,x);
plot(t,x,t,y1)
xlabel('Date and Time')
ylabel('Flow (m3/h)')
legend('Flow','Peak Flow')
However, I got an error "Error using filter. Not enough input arguments." Do you know why I got this problem? I look at the example on the web, it should work. Or maybe because they have different size of t as x-axis? But y1 is the part of x. I got stuck here. Could you please help me? Thank you in advance.

回答 (1 件)

KSSV
KSSV 2017 年 10 月 26 日
Read the documentation of filter https://in.mathworks.com/help/matlab/ref/filter.html. It needs three variables as input and you are providing only two inputs.

カテゴリ

Help Center および File ExchangeGraphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by