Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Can't use subs(sym_array,vector) because Matlab assumes I want to replace the first component of sym_array and not the whole array

1 vue (au cours des 30 derniers jours)
pefernan
pefernan le 20 Avr 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021
x = sym('x',[1 2 3])
subs(x,[1 2 3])
returns:
[1,2,3,x2,x2,x2,x3,x3,x3]
How do I fix this to return [1,2,3]?

Réponses (1)

Chaitral Date
Chaitral Date le 25 Avr 2017
See the below code,
syms x x1 x2 x3;
x = sym('x',[1 3]);
x=subs(x,[x1,x2,x3],[1, 2,3]);
This will give you,
x =
[ 1, 2, 3]

Cette question est clôturée.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by