Error using plot: Value not a numeric scalar

조회 수: 105 (최근 30일)
Romio
Romio 2020년 1월 30일
I am using this running average function to smooth out dome noisey data.
function y = RunningAvg(x,w)
wts = ones(1, w) / w
new = conv(x, wts, 'same');
end
However, when I plot the filtered signal, I get this error massage
Error using plot
Value not a numeric scalar
  댓글 수: 7
Romio
Romio 2020년 1월 31일
and it is true that there are some noninterger data in the x_smooth. Is there anyway to override that?
Walter Roberson
Walter Roberson 2020년 1월 31일
Yes, it was that line
plot(t,x_smoothed,'linewidth','2')
that we were looking for.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 1월 31일
plot(t,x_smoothed,'linewidth','2')
Line widths must be numeric.
plot(t,x_smoothed,'linewidth',2)
  댓글 수: 2
Romio
Romio 2020년 1월 31일
I am such an idiot! Thank you!!!!!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by