hello i need some help:
显示 更早的评论
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 个评论
Geoff Hayes
2022-6-11
@Rosmael zidane lekeufack - what is the error message? what is the code that generates the error?
回答(1 个)
Walter Roberson
2022-6-11
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!