MATLAB VECTOR FIELDS j COMPONENT
Afficher commentaires plus anciens
Hi everbody , I am trying to create a function tthat take a vector fforce field from user and seperate its i j k components.

ı am thinking to take the input as symfun and subs ,for example (i=1,j=0,k=0) for i component but as you can see matlab reads j as i (input was xi+yj+kz and the output of force_field variable xi+yi+zk) how can ı fix it ?
Réponses (1)
syms x y z i j k t r
f = dot([x y z],[i j k])
ff = symfun(f,[x y z i j k])
subs(ff,{x y z},{1 0 0})
3 commentaires
VBBV
le 9 Déc 2022
use dot product function instead
Talha Yagli
le 9 Déc 2022
Modifié(e) : Talha Yagli
le 9 Déc 2022
VBBV
le 9 Déc 2022
When the user enters inputs in form of
[x y z i j k]
It is read into say X , then do
f = dot(X(1:3),X(4:6))
Catégories
En savoir plus sur Symbolic Math Toolbox 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!