I can not use i j k as a sym type what should I do
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Error using syms (line 284)
Unable to create a symbolic variable 'i' by using 'syms' inside a MATLAB function because 'i' is an existing function name, class name, method name, and
so on. Use 'sym' instead.
I keep getting this error when I am trying to get this (x^2)*i+(y*j) equation from App designer.Firstly I get this equation as a string type and convert it to the sym to do sum mathematical calculations.
It works outside of the Appdesigner but when I try to write this to the appdesigner edit text, I got this error
How can I solve this ?
0 comentarios
Respuestas (1)
Askic V
el 16 de Dic. de 2022
Editada: Askic V
el 16 de Dic. de 2022
This is how I would solve this problem:
c1 = test()
function c1 = test()
syms x y z k real
i = sym('i');
j = sym('j');
v1 = sym(dot([x^2 y z],[i j k]));
c1 = subs(v1,{x y z},{2 -3 2});
end
As you can see, i and j can be defined as symbolic variables inside the function. You just neen to use sym function.
0 comentarios
Ver también
Categorías
Más información sobre Symbolic Variables, Expressions, Functions, and Settings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
