フィルターのクリア

Please help me to resolve it . I am using it in Ant Colony algorithm

2 ビュー (過去 30 日間)
sgb
sgb 2013 年 4 月 7 日
コメント済み: monisha silvia 2018 年 3 月 18 日
??? Error using ==> times
Matrix dimensions must agree.
Error in ==> ACO at 215
p = ((1-rho).*p + rho.*delta_p_current.*v).*delta_p_current +
p.*(abs(1-delta_p_current));
  1 件のコメント
monisha silvia
monisha silvia 2018 年 3 月 18 日
how did u rectify this error, can u send the code and input image.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2013 年 4 月 7 日
All of the variables you have on that line need to be the same size() or else need to be scalars, but at least one of the variables is not the right size.
  3 件のコメント
Walter Roberson
Walter Roberson 2013 年 4 月 7 日
My guess is that at some point you used code similar to
[rows, cols] = size(p);
delta_p_current = zeros(rows, cols);
This is not certain to work, because of an oddity in the definition of the size() function. If you use
s = size(p);
then s would be the vector [128 128 3]
and if you used
[rows cols bands] = size(p)
then rows would be 128, cols would be 128, and bands would be 3.
But if you used
[rows cols] = size(p)
and p has more dimensions than you have variables on the left, then the last variable you gave on the left will be all the remaining dimensions multiplied together -- so in this case, rows would be 128, but cols would be (128 * 3) = 384. In this way, the product of the returned values is always the same as the number of elements in the original array, even though that startles you that the second output is not the size of the second dimension.
sgb
sgb 2013 年 4 月 7 日
Exactly!!!!!!!!!
I changed the input image bit depth to 8 bits and resolved the problem. Thanks a lot for ur timely replies. This is really a good place for learning students. I thank this site very much

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRobotics についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by