How to combine multiple output from a function into 1?
Afficher commentaires plus anciens
Hi all,
There are some functions in Matlab which gives multiple outputs, such as:
K>> [x, y, z] = ndgrid(-1:0, -1:0, -1:0)
x(:,:,1) =
-1 -1
0 0
x(:,:,2) =
-1 -1
0 0
y(:,:,1) =
-1 0
-1 0
y(:,:,2) =
-1 0
-1 0
z(:,:,1) =
-1 -1
-1 -1
z(:,:,2) =
0 0
0 0
Is there a universal way to allow this kind of functions to give only 1 output which contains all available single outputs? Something like a cell contains 3 elements which are x,y and z here? Of course if there are more outputs than 3 from ndgrid the cell elements should increase accordingly.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!