Why is it wrong: e3=sym('si​n(x)^2+cos​(x)=0')

1 Ansicht (letzte 30 Tage)
zhenyu zeng
zhenyu zeng am 22 Apr. 2019
Kommentiert: madhan ravi am 22 Apr. 2019
Why is it wrong: e3=sym('sin(x)^2+cos(x)=0')

Akzeptierte Antwort

madhan ravi
madhan ravi am 22 Apr. 2019
Bearbeitet: madhan ravi am 22 Apr. 2019
sym('') was replaced by str2sym('') in latest versions and you seem to be using 2018b version
e3=str2sym('sin(x)^2+cos(x)=0')
% ^^^^^^^
  10 Kommentare
zhenyu zeng
zhenyu zeng am 22 Apr. 2019
Why not use str2sym('a') instead of sym('a’)?
madhan ravi
madhan ravi am 22 Apr. 2019
It only works for only a number or a variable. Read the documentations. Take MATLAB on-ramp course to learn the basics of MATLAB.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

KSSV
KSSV am 22 Apr. 2019
syms x
e3 = sin(x)^2+cos(x)==0

Community Treasure Hunt

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

Start Hunting!

Translated by