Input format of the smooth function

조회 수: 3 (최근 30일)
中祥 范
中祥 范 2024년 12월 9일
댓글: Adam Danz 2024년 12월 9일
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 ?

답변 (1개)

Sameer
Sameer 2024년 12월 9일
편집: Sameer 2024년 12월 9일
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
Adam Danz
Adam Danz 2024년 12월 9일
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

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

카테고리

Help CenterFile Exchange에서 Smoothing에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by