particle(i).clustervaulues(k,j) = 1/(pdist2(particle(i).position(k),x(j)*pdist2(basestation,particle(i).position(k))));
particle.position is a 15x2 matrix, x is 100x2 and basestation is [50 50] but for the second pdist2 it tells me there is a column mismatch even though they all have to columns. the first pdist2 works fine,
any help would be appreciated

 採用された回答

Star Strider
Star Strider 2021 年 3 月 25 日

0 投票

If ‘basestation’ is a (50x50) matrix, and the distance calculation is to be with a 2-column array, that is going to be a problem for pdist2.
The two arrays can have different numbers of rows, however they must have the same number of columns. The documentation section on X,Y specifies this.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Functions についてさらに検索

製品

リリース

R2020b

タグ

質問済み:

2021 年 3 月 25 日

回答済み:

2021 年 3 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by