How to sum matrix of different size on Simulink? (R2019a)
Afficher commentaires plus anciens
I have this block in my system:

The expected behavior is to perform as it's done on Matlab.
However, I receive this error:

How can I solve this problem?
PS1: I know that it seems pretty stupid. But maybe I'm pretty stupid.
PS2: I searched. Really.
Réponse acceptée
Plus de réponses (1)
BobH
le 17 Mar 2020
The dimensions must agree, in MATLAB.
Z = zeros(400,32);
O = ones(1,32);
Z+O;
Error using +
Matrix dimensions must agree.
O = ones(400,32);
r = Z+O;
size(r)
ans =
400 32
4 commentaires
madhan ravi
le 17 Mar 2020
BobH implicit addition indeed exists in MATLAB
BobH
le 18 Mar 2020
It does, starting with R2016b. If it's not working, a possibility is that the OP is using an older version and is seeing correct behavior for that version. Rubem, what version are you using?
Rubem Pacelli
le 18 Mar 2020
Modifié(e) : Rubem Pacelli
le 18 Mar 2020
madhan ravi
le 18 Mar 2020
BobH if you could see in each thread of the question there is a specific field named Release for the OPs to fill in the version they use.
Catégories
En savoir plus sur Array and Matrix Mathematics 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!