フィルターのクリア

converting index to coordinates(row,col) is giving me error

7 ビュー (過去 30 日間)
Sparsh Garg
Sparsh Garg 2021 年 8 月 4 日
コメント済み: Sparsh Garg 2021 年 8 月 4 日
Apologies in advance for asking so many questions,switching to matlab after 8 years
so I have an image of dimension 146x211 matrix,after some processing I get a struct and one of the structure's entry is position.
the position has weird values like 12744,13473 etc.
Now we need to convert it to [row,col],so I want to find out which row and column corresponds to 13473 etc.
I have included the image and strucutre for reference purposes.
running ind2sub like this
sz=[146,211];
>> [row,col]=ind2sub(12744,sz);
gives col [1,1] and row[146,211] which is not correct because there is only one entry corresponding to 12744 in the edges.position not 2.But acc to this there is [146,1] and [211,1].

採用された回答

Walter Roberson
Walter Roberson 2021 年 8 月 4 日
[row,col]=ind2sub(sz,12744)
  1 件のコメント
Sparsh Garg
Sparsh Garg 2021 年 8 月 4 日
thanks my dumbness astounds me.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImport, Export, and Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by