Al momento, stai seguendo questo contributo
- Vedrai gli aggiornamenti nel tuo feed del contenuto seguito
- Potresti ricevere delle email a seconda delle tue preferenze per le comunicazioni
This function takes an array as input and returns each element of the array as a separate output. It is similar in function to deal, but less verbose when dealing with a single matrix.
I created this function because I wanted a one-liner alternative to the following code:
c = num2cell(rect); %rect is a rectangle position vector
[x,y,wid,hei] = c{:};
Now I can simply use:
[x,y,wid,hei] = matsplit(rect);
The number of output arguments does not need to match the number of elements in the input array.
Alternatively, you can split the matrix by row or column using the second input DIM.
Example:
A = [1 2 3 4
1 2 3 4
1 2 3 4];
[B,C] = matsplit(A,1);
returns
B = [1;1;1];
C = [2;2;2];
Cita come
Matthew Eicholtz (2026). matsplit (https://it.mathworks.com/matlabcentral/fileexchange/48439-matsplit), MATLAB Central File Exchange. Recuperato .
Informazioni generali
- Versione 1.3.0.0 (568 Byte)
Compatibilità della release di MATLAB
- Compatibile con qualsiasi release
Compatibilità della piattaforma
- Windows
- macOS
- Linux
