필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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 CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by