Main Content

La traduzione di questa pagina non è aggiornata. Fai clic qui per vedere l'ultima versione in inglese.

Matrici e array

Creare, combinare, rimodellare, riorganizzare e indicizzare gli array

Le matrici e gli array sono la rappresentazione fondamentale delle informazioni e dei dati in MATLAB®. È possibile creare array e griglie comuni, abbinare array esistenti, manipolare la forma e il contenuto di un array e utilizzare l'indicizzazione per accedere agli elementi dell'array. Per una panoramica sulla manipolazione delle matrici e degli array, guardare Lavorare con gli array.

Funzioni

espandi tutto

zerosCreate array of all zeros
onesCreate array of all ones
randUniformly distributed random numbers
trueLogical 1 (true)
falseLogical 0 (false)
eyeIdentity matrix
diagCreate diagonal matrix or get diagonal elements of matrix
blkdiagBlock diagonal matrix
catConcatenate arrays
horzcatConcatenate arrays horizontally
vertcatConcatenate arrays vertically
repelemRepeat copies of array elements
repmatRepeat copies of array
combinationsGenerate all element combinations of arrays (Da R2023a)
linspaceGenerate linearly spaced vector
logspaceGenerate logarithmically spaced vector
freqspaceFrequency spacing for frequency response
meshgrid2-D and 3-D grids
ndgridRectangular grid in N-D space
lengthLength of largest array dimension
sizeArray size
ndimsNumber of array dimensions
numelNumber of array elements
isscalarDetermine whether input is scalar
isvectorDetermine whether input is vector
ismatrixDetermine whether input is matrix
isrowDetermine if input is row vector
iscolumnDetermine if input is column vector
isemptyDetermine whether array is empty
issortedDetermine if array is sorted
issortedrowsDetermine if matrix or table rows are sorted
isuniformDetermine if vector is uniformly spaced (Da R2022b)
sortSort array elements
sortrowsSort rows of matrix or table
headGet top rows of array or table
tailGet bottom rows of array or table
flipFlip order of elements
fliplrFlip array left to right
flipudFlip array up to down
rot90Rotate array 90 degrees
transposeTranspose vector or matrix
ctransposeComplex conjugate transpose
permutePermute array dimensions
ipermuteInverse permute array dimensions
circshiftShift array circularly
shiftdimShift array dimensions
reshapeReshape array by rearranging existing elements
squeezeRemove dimensions of length 1
colonVector creation, array subscripting, and for-loop iteration
endTerminate block of code or indicate last array index
ind2subConvert linear indices to subscripts
sub2indConvert subscripts to linear indices

Argomenti