How to obtain paths from coordinates?

1 回表示 (過去 30 日間)
Francesco
Francesco 2014 年 2 月 4 日
コメント済み: Image Analyst 2014 年 3 月 22 日
I have a .txt formatted in this way:
  2 件のコメント
Walter Roberson
Walter Roberson 2014 年 2 月 4 日
Are these "all the paths that are a single step", or do they include multi-step paths? Full connectivity is to be assumed?
Image Analyst
Image Analyst 2014 年 3 月 22 日
Francesco, please don't edit your posts so as to destroy them and make people's answers meaningless and confusing. They may elect not to help you in the future if you do that.

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

採用された回答

Walter Roberson
Walter Roberson 2014 年 2 月 5 日
[X, Y] = ndgrid(1:N);
identifiers = arrayfun(@(X,Y) sprintf('%d_%d', X, Y), X, Y, 'Uniform', 0);
Now just remove the diagonal ones and reshape into whatever order you want.
I do not understand how you want the distance to fit into this, or why you want to generate these identifiers.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by