How can I make a symbolic function with vector input?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hansol Lee
il 21 Apr 2020
Risposto: Jyotsna Talluri
il 24 Apr 2020
I want to make a symbolic function with vector input.
I tried a code
a=sym('a',[1 3]);
f(a)=a(1)^2+a(2)+a(3)*a(1);
k=[1 1 1];
f(k)
But it didn't work. I could find that f(1,1,1) works, but I want to make f with f([1 1 1]). How could I do it?
0 Commenti
Risposta accettata
Jyotsna Talluri
il 24 Apr 2020
a=sym('a',[1 3]);
f= @(a)(a(1)^2+a(2)+a(3)*a(1));
k=[1 1 1];
f(k)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Symbolic Math Toolbox 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!