como ultrapassar esse erro

1 次查看(过去 30 天)
Adalberto
Adalberto 2023-4-2
评论: Adalberto 2023-4-2
syms x
int (cos(x),x,-pi/2,pi/2);
Error using sym/subsindex
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function
body must be sym expression.
Error in indexing (line 1079)
R_tilde = builtin('subsref',L_tilde,Idx);
  6 个评论
Cris LaPierre
Cris LaPierre 2023-4-2
编辑:Cris LaPierre 2023-4-2
Ejecuta el siguiente codigo y avisanos el resultado
which syms
which int
ver
Ha instalado el Symbolic Math Toolbox? Si no, y esta incluido en su licencia, lo puede instalar usando Add-Ons Explorer
Dyuman Joshi
Dyuman Joshi 2023-4-2
Cris, if the Symbolic Math Toolbox is not installed then it would give the following error - 'Undefined function 'syms' for input arguments of type 'char' after the first line/.

请先登录,再进行评论。

回答(1 个)

Cris LaPierre
Cris LaPierre 2023-4-2
Parece que haya creado un variable llamado int.
% Para recrear el error (el mensaje es un poco diferente en R2023a
int=5;
syms x
int (cos(x),x,-pi/2,pi/2);
Error using indexing
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym expression.
En R2022b, el mensaje es
Error using sym/subsindex
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body
must be sym expression.
Hay que vaciar el variable int
clear int
syms x
int(cos(x),x,-pi/2,pi/2)
  1 个评论
Adalberto
Adalberto 2023-4-2
ok.
muito obrigado Cris, já fiz um release na versão, agora estou a instalar o symbolic toolbox. para testar.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Equation Solving 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by