필터 지우기
필터 지우기

ones(size(data, 2), 1) , what mean??

조회 수: 17 (최근 30일)
mina
mina 2013년 3월 2일
ones(size(data, 2), 1) , what mean??

답변 (1개)

Wayne King
Wayne King 2013년 3월 2일
편집: Wayne King 2013년 3월 2일
Create a vector of ones which has the number of rows equal to the number of columns in the matrix data and 1 column
So if data is 100x10
data = randn(100,10);
then
y = ones(size(data,2),1);
creates a vector y that is 10x1.
If data is 100x1000
then
y = ones(size(data,2),1);
creates a vector of 1s that is 1000x1

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by