フィルターのクリア

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 Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by