I am working on Matlab 2017b and I am stuck on the problem of solving numerically an equation. I've followed the instructions but I can't find what is wrong. Here is my code:
syms x
solve(x^5 - 1 == 0, x)
Attempt to execute SCRIPT solve as a function:
C:\Users\jose-\Documents\MATLAB\solve.m
Error in equationsolver (line 2) solve(x^5 - 1 == 0, x)
I think that the code is not wrong, but the configuration of my software could, because the code is the same as the written one in the Matlab page.

 채택된 답변

madhan ravi
madhan ravi 2018년 10월 21일
편집: madhan ravi 2018년 10월 21일

1 개 추천

you have a file name called as solve.m please delete it , contradicts with the matlab's inbuilt function solve
Type
which
in command window
also you can use the following solver
syms x
vpasolve(x^5 - 1 == 0, x)
location is shown C:\Users\jose-\Documents\MATLAB\solve.m just rename solve.m to solve1.m to avoid this error

댓글 수: 7

madhan ravi
madhan ravi 2018년 10월 21일
if it solved your problem please accept the answer so that other people know it had been solved , if something is not clear let know
José Lindoro Fonseca Fierro
José Lindoro Fonseca Fierro 2018년 10월 21일
I have changed the name of solve.m archives but it doesn't work, but the vpasolve function has worked well
madhan ravi
madhan ravi 2018년 10월 21일
What’s your error message after renaming solve.m?
José Lindoro Fonseca Fierro
José Lindoro Fonseca Fierro 2018년 10월 21일
Attempt to execute SCRIPT solve as a function:
C:\Users\jose-\Documents\MATLAB\solve.m
Error in equationsolverexample (line 2) solve(x^5 - 1 == 0, x)
it means you didn't rename solve.m because its showing you the exact location
try the following :
1) go to C
2) to users
3) jose-
4)Documents
5)MATLAB
6)right click solve (either delete or rename solve.m)
José Lindoro Fonseca Fierro
José Lindoro Fonseca Fierro 2018년 10월 21일
Problem resolved. Thanks
madhan ravi
madhan ravi 2018년 10월 21일
you’re welcome

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

추가 답변 (0개)

카테고리

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

제품

릴리스

R2017b

태그

Community Treasure Hunt

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

Start Hunting!

Translated by