using relational operators with the symbolic math toolbox?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
is there anyway i can use relational operators with the symbolic math toolbox? i have read the other answer for the same question and it wasn't very clear to me. could someone please explain?
0 comentarios
Respuesta aceptada
Walter Roberson
el 19 de Feb. de 2011
Yes, there is a MuPad call named "is" that will test a condition. It is not strictly constrained to numeric relations: it can test properties such as data types, and when assumptions have been applied, it may be able to decide relationships between expressions that involve symbolic variables. Most of the time, though, expressions that involve symbolic variables without assumptions are not decidable, and is() will return false for those cases.
Coding the relational expression at the Matlab level can be a problem, so you usually end up having to express it as a string and using subs() to transfer the values from the Matlab engine to the symbolic engine.
0 comentarios
Más respuestas (1)
Andrew Newell
el 19 de Feb. de 2011
If you have assigned numeric values to your symbolic variables, you could do something like this:
syms x y
x = 1; y = 2;
if double(y) > double(x)
disp('True is true!')
else
disp('Doubleplusungood.')
end
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!