Error using plot: Value not a numeric scalar
Mostra commenti meno recenti
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 Commenti
David Hill
il 31 Gen 2020
Please provide example inputs (x,w) to your function. There is no y that is returned.
Walter Roberson
il 31 Gen 2020
Modificato: Walter Roberson
il 31 Gen 2020
we need to see the plot call
Romio
il 31 Gen 2020
Walter Roberson
il 31 Gen 2020
It appears that w would be expected to be a positive integer. But we still need to see the call to plot()
Romio
il 31 Gen 2020
Romio
il 31 Gen 2020
Walter Roberson
il 31 Gen 2020
Yes, it was that line
plot(t,x_smoothed,'linewidth','2')
that we were looking for.
Risposte (1)
Walter Roberson
il 31 Gen 2020
plot(t,x_smoothed,'linewidth','2')
Line widths must be numeric.
plot(t,x_smoothed,'linewidth',2)
2 Commenti
Romio
il 31 Gen 2020
Bahubalendruni Bindu Satya Narayana Sai Varma
il 26 Mag 2021
Thank you
Categorie
Scopri di più su Electrical Block Libraries in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
