Why is my last line coming up as an empty sym?

์กฐํšŒ ์ˆ˜: 1 (์ตœ๊ทผ 30์ผ)
Amy Joyce Valencia
Amy Joyce Valencia 2021๋…„ 10์›” 22์ผ
๋Œ“๊ธ€: Amy Joyce Valencia 2021๋…„ 10์›” 22์ผ
There's a couple steps to this problem. Expand and then simplify the equation. The last is to solve this equation: when x =2. But when I run it, it comes up empty
๐‘ฆ= (๐‘ฅ^3 +1)(๐‘ฅ^2 +2๐‘ฅโˆ’5)(๐‘ฅ^2 โˆ’3)^2
clear
syms x
x==2
y = (x^3+1)*(x^2+2*x-5)*(x^2-3)^2 %deleted "eqn =' double = leads to error
expand(y) %switch out "eqn" with "y"
simplify(y) %same as above
solve(subs(y,x,2),y)

๋‹ต๋ณ€ (1๊ฐœ)

Cris LaPierre
Cris LaPierre 2021๋…„ 10์›” 22์ผ
I don't think you need to use solve in the final line. Substituting in 2 for x will return a value for y. There is nothing left to solve for.
syms x
y = (x^3+1)*(x^2+2*x-5)*(x^2-3)^2 %deleted "eqn =' double = leads to error
yย =ย 
subs(y,x,2)
ansย =ย 
27
  ๋Œ“๊ธ€ ์ˆ˜: 1
Amy Joyce Valencia
Amy Joyce Valencia 2021๋…„ 10์›” 22์ผ
Thank you!

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Symbolic Math Toolbox์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

์ œํ’ˆ


๋ฆด๋ฆฌ์Šค

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by