Why do I receive this message errorr ?
古いコメントを表示
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 件のコメント
RADWAN A F ZEYADI
2021 年 10 月 8 日
Walter Roberson
2021 年 10 月 8 日
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
2021 年 10 月 8 日
Walter Roberson
2021 年 10 月 8 日
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
2021 年 10 月 8 日
Walter Roberson
2021 年 10 月 10 日
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)) )
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!