hello i need some help:
Show older comments
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 Comment
Geoff Hayes
on 11 Jun 2022
@Rosmael zidane lekeufack - what is the error message? what is the code that generates the error?
Answers (1)
Walter Roberson
on 11 Jun 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.
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!