Simple Solve command not working.

My command:
solve('0.5 - 25/8 + 4*E = 0',E)
The error:
Warning: Explicit solution could not be found. > In solve at 83
ans =
[ empty sym ]
W...what? Is this a joke?
MATLAB 7.12.0(R2011a)

댓글 수: 1

baba gump
baba gump 2012년 7월 3일
I used "syms E" first off.
Funny thing is, if I change the E to an x, it works. WTF?

댓글을 달려면 로그인하십시오.

답변 (1개)

Teja Muppirala
Teja Muppirala 2012년 7월 4일

1 개 추천

When you use solve with a string input, it interprets the "E" as exp(1). Try this:
solve('x = E', 'x')
If you really want to call your variable E, then remove the apostrophes:
syms E
solve(0.5 - 25/8 + 4*E == 0,E)

질문:

2012년 7월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by