Borrar filtros
Borrar filtros

Error while using syms in matlab

1 visualización (últimos 30 días)
reema shrestha
reema shrestha el 26 de Jun. de 2017
Editada: Jan el 26 de Jun. de 2017
I am a beginner to the Matlab and currently using Matlab7. I tried with the basic example of solving a polynomial equation.
syms x
y=x^2+1;
solve(y)
When I run the program,I get some error in command files like
??? Attempt to execute SCRIPT class as a function.
Error in ==> sym.sym>char2sym at 385
S = class(struct('s',x),'sym');
Error in ==> sym.sym at 92
S = char2sym(x);
Error in ==> syms at 74
assignin('caller',x,sym(x));
Error in ==> solve at 1
syms x
Anyone who could help me with it?? I don't even understand the error message.

Respuesta aceptada

Jan
Jan el 26 de Jun. de 2017
Editada: Jan el 26 de Jun. de 2017
Which is the current folder? The parent folder of class.m, which contains the documentation only? Then change the current directory, e.g.:
cd(tempdir)
and run the code again.
Or did you create a script called "class.m" by your own? If so: Don't do this.
  2 comentarios
Rik
Rik el 26 de Jun. de 2017
Just a suggestion: could it also be an incompatibility? Matlab 7 is from 2004. That's quite a list of release notes to go through...
It is better to get a much newer Matlab version. Faster, more options, less (or at least other) bugs, etc.
reema shrestha
reema shrestha el 26 de Jun. de 2017
Thank you so much @Jan simon. It worked. I'd been scratching my head for days and finally it worked. :) :)

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by