Effacer les filtres
Effacer les filtres

definition of a vector

11 vues (au cours des 30 derniers jours)
Hamza Harbi
Hamza Harbi le 25 Fév 2023
Commenté : Torsten le 25 Fév 2023
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 commentaire
Torsten
Torsten le 25 Fév 2023
a=randi([1 10],1,1,3);
isvector(squeeze(a))
ans = logical
1

Connectez-vous pour commenter.

Réponse acceptée

the cyclist
the cyclist le 25 Fév 2023
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.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by