What's the difference between vectors and arrays?

98 ビュー (過去 30 日間)
Francesco Ferigo
Francesco Ferigo 2017 年 5 月 31 日
回答済み: Aloysius Fernandez 2021 年 8 月 31 日
As per subject, what's the difference between vectors and arrays in Matlab?

回答 (4 件)

Stephen23
Stephen23 2017 年 5 月 31 日
編集済み: Stephen23 2017 年 5 月 31 日
Just the size.
All arrays, matrices, vectors, and scalars in MATLAB are actually ND-arrays with infinite trailing singleton dimensions. A matrix has dimension three and higher as singleton. A vector has one non-singleton dimension (in MATLAB this is restricted to the first or second dimension, as the isvector docs show). There are no different classes for these different size arrays, the size alone is what distinguishes them (just like in mathematics).
"Arrays in MATLAB are N-dimensional, with an infinite number of trailing singleton dimensions."

KSSV
KSSV 2017 年 5 月 31 日

Aloysius Fernandez
Aloysius Fernandez 2021 年 8 月 31 日
simply put - In MATLAB, all vectors are arrays, but not all arrays are vectors - they could be matrices or scalars.

Steven Lord
Steven Lord 2017 年 5 月 31 日
MATLAB functions that expect a vector as input expect to be called with an array A as input for which isvector(A) returns true.
  1 件のコメント
Stephen23
Stephen23 2017 年 5 月 31 日
This is also explained in my answer.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by