Hello everyone!
I have a problem with trying to solve equations in matlab r2017b:
Here's the code:
close all, clear all, clc
syms x
eq = x^2 == 9;
solx = solve(eq, x)
Unfortunately, matlab understands the line x^2 == 9 to be a statement logically equal to zero, so matlab understands my code to mean: solve(0,x)
Which obviously has no solution.
Any help will be appreciated

댓글 수: 3

r2017a:
solx =
-3
3
Whenever I write:
syms x
eq = x^2 == 9;
Matlab understands eq to be logically 0. So it tries to solve(0,x)
Birdman
Birdman 2018년 3월 22일
Check my answer.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2018년 3월 22일

댓글:

2018년 3월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by