Input format of the smooth function

3 Ansichten (letzte 30 Tage)
中祥 范
中祥 范 am 9 Dez. 2024
Kommentiert: Adam Danz am 9 Dez. 2024
I read the instructions for the smooth function, and I want to know if the input y to the function must be in column vector form.
Can I enter a row vector for smoothing ?

Antworten (1)

Sameer
Sameer am 9 Dez. 2024
Bearbeitet: Sameer am 9 Dez. 2024
Yes, the input 'y' to the smooth function can be in either row or column vector form. If you step inside the function, the input 'y' is converted to a column vector using the statement "y = y(:)"
Hope this helps!
  1 Kommentar
Adam Danz
Adam Danz am 9 Dez. 2024
y can be any sized array. As Sameer states, it's reshaped to a column vector.
A = rand(6,5,2,8,4);
s1 = smooth(A); % 5D array
s2 = smooth(A(:)); % Column vector, same data
isequal(s1,s2) % same result
ans = logical
1

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Smoothing finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by