Convert cell array of syms to double

4 Ansichten (letzte 30 Tage)
yonatan s
yonatan s am 19 Okt. 2020
Kommentiert: yonatan s am 19 Okt. 2020
Hello, after running the following code (where f(1), f(2) are constants, and u is a vector), X ends up being a u-sized cell array where each cell is of class 'sym'. How do I convert X to double?
syms x positive
eqn = f(1)*x.^2+f(2)*x == u;
X = (arrayfun(@solve,eqn,'uniform',0));
Thanks.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 19 Okt. 2020
double([X{:}]).'

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by