How to find if a symbolic operation contains a or function?

1 vue (au cours des 30 derniers jours)
gonzalo Mier
gonzalo Mier le 17 Nov 2020
Commenté : gonzalo Mier le 19 Nov 2020
I'm trying to find if a symbolic equation has the 'or' function or not.
I have tried to do this:
syms a b
has(a|b,'or') % logical 0
has(or(a,b),'or') % logical 0
I don't know if this is a bug. Do you know other ways to do this?
Thank you
  2 commentaires
gonzalo Mier
gonzalo Mier le 17 Nov 2020
For now, I am doing this:
f = a|b;
contains(char(f),'|');
If anyone has a better way, please share.
VBBV
VBBV le 18 Nov 2020
strfind('a|b','|')

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 18 Nov 2020
hasSymType(a|b, 'or')

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by