Operators "concatenation" ?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Nicolas Douillet
il 4 Mag 2020
Commentato: Nicolas Douillet
il 4 Mag 2020
Hi,
Is there a way to "concatenate" two or more Matlab operators while chaining several operations ?
For instance, I have a complex function returning a cell array :
C = my_complex_function(input)
And in the following, in another function I would like to perform for instance :
T = unique([C{:}]);
But via a direct call to the first function*, meaning I would like to avoid to create the temporary variable C in these latter function (the goal is to do it in one step instead of two or more).
Is it possible ? Do you know a way to do this ? (Of course I mean without mofifying the first function at all, including its return type)
* The idea is something like
T = unique([my_complex_function(input){:}])
Thanks for any help.
0 Commenti
Risposta accettata
James Tursa
il 4 Mag 2020
No. MATLAB syntax does not allow using ( ) or { } right after a function call. You could of course create a third function to do these two steps behind the scenes if you wanted.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!