For clarity, the original answer only deals with 2d vectors, but I may not know the size of mine.
Function with multiple inputs to function with vector input
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Josef Lát
le 3 Nov 2022
Réponse apportée : Fangjun Jiang
le 3 Nov 2022
f = @(z1, z2, ..., zn) ...
and I would need to unwrap a vector z = [z1, z2, ..., zn] instead:
f = @(z) ...
How can this be done?
2 commentaires
Réponse acceptée
Fangjun Jiang
le 3 Nov 2022
f=@(z1,z2,z3) z1+z2+z3;
f(1,2,3)
a=1:3;
b=num2cell(a);
f(b{:})
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!