Error using plot: Value not a numeric scalar

28 ビュー (過去 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!!!!!
Bahubalendruni Bindu Satya Narayana Sai Varma
Thank you

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

カテゴリ

Help Center および File ExchangeElectrical Block Libraries についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by