필터 지우기
필터 지우기

definition of a vector

조회 수: 11 (최근 30일)
Hamza Harbi
Hamza Harbi 2023년 2월 25일
댓글: Torsten 2023년 2월 25일
why an array of size 1-by-1-by-N is not a vector?
a=randi([1 10],1,1,3);
isvector(a)
ans = logical
0
  댓글 수: 1
Torsten
Torsten 2023년 2월 25일
a=randi([1 10],1,1,3);
isvector(squeeze(a))
ans = logical
1

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

채택된 답변

the cyclist
the cyclist 2023년 2월 25일
Because, according to the documentation for isvector, "A vector is a two-dimensional array that has a size of 1-by-N or N-by-1".
One can obviously make the argument that that is not a good definition of a vector. But the behavior is well documented.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by