hello i need some help:
Afficher commentaires plus anciens
i working for one code, but i want to use the reponse to a resolution eqution with solve to continuous my work, but i have this error : i working for one code, but i want to use the reponse to a resolution eqution with solve to continuous my work, but i have this error : X = privBinaryOp(A, B, 'symobj::zip', '_subtract'); i need some help to resolv this problem
1 commentaire
Geoff Hayes
le 11 Juin 2022
@Rosmael zidane lekeufack - what is the error message? what is the code that generates the error?
Réponses (1)
Walter Roberson
le 11 Juin 2022
0 votes
That error can have two causes:
- you might be trying to subtract two objects of fundamentally different sizes, such as trying to subtract a vector of length 3 from a vector of length 4
- you might be trying to take advantage of implicit expansion, such as trying to subtract the mean of each row (a vector) from each row in a 2d array. If you were working with numeric objects in any reasonably new version of MATLAB, then MATLAB would automatically extend the vector into a 2d array to match. However when you work with Symbolic variables, MATLAB does not do the expansion, and would give you the error you saw.
If you are trying to take advantage of expansion, then use bsxfun or (often easier) repmat the variables to be matching sizes.
But if you are just trying to subtract things of different sizes, then you need to fix your logic.
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!