What's the difference between vectors and arrays?

101 vues (au cours des 30 derniers jours)
Francesco Ferigo
Francesco Ferigo le 31 Mai 2017
As per subject, what's the difference between vectors and arrays in Matlab?

Réponses (4)

Stephen23
Stephen23 le 31 Mai 2017
Modifié(e) : Stephen23 le 31 Mai 2017
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 le 31 Mai 2017

Aloysius Fernandez
Aloysius Fernandez le 31 Août 2021
simply put - In MATLAB, all vectors are arrays, but not all arrays are vectors - they could be matrices or scalars.

Steven Lord
Steven Lord le 31 Mai 2017
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 commentaire
Stephen23
Stephen23 le 31 Mai 2017
This is also explained in my answer.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by