Why do I receive this message errorr ?
Afficher commentaires plus anciens
Array dimensions must match for binary array op
this is the message error that i have obtained when i tried to perturb my data by this equation( Pert = obs + sqrt(alpha*Cd).*randn(nd, ne))
where obs=51*71*3 .,, alpha =0.25,, cd=71*71 ,,nd=51,ne=500 .
why do i recive this error ? thanks in advance
6 commentaires
RADWAN A F ZEYADI
le 8 Oct 2021
Walter Roberson
le 8 Oct 2021
51 x 500 x 71 might be possible, depending on what multiplications are supposed to be of. However, obs is 51 x 71 x 3 and it is not at all clear where the x 3 should go.
RADWAN A F ZEYADI
le 8 Oct 2021
Walter Roberson
le 8 Oct 2021
Could the randn(51,500) be randn(71,500) instead?
If so then obs [51 x 71] * sqrt(alpha*Cd) [71 x 71] * randn [71 x 500] could give a 51 x 500 result that involved all of the arrays.
But if you are asking to add something to obs [51 x 71 x 3] then you are not going to be able to get a 51 x 500 x 3 result.
RADWAN A F ZEYADI
le 8 Oct 2021
Walter Roberson
le 10 Oct 2021
No. It is simply impossible to do what you want. You are trying to take a 51 x 71 x 3 array and add something to it to get a 51 x 500 x 3 result.
pagemtimes( obs, sqrt(alpha*Cd) * randn(71,500))
would get you a 51 x 500 x 3 result -- but it is not clear that is the formula that you would want, as it is pure multiplication with no addition. Also, potentially you might be wanting
pagemtimes( obs, pagemtimes(sqrt(alpha*Cd), randn(71,500,3)) )
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Linear Algebra 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!