Accessing/Extracting Two values From a Single Field

Hello Guys. I am having some problem in accessing the values stored in a field. I have also uploaded an image to make my question more convenient and understandable. I hope I'll get a quick response and a working answer which solve my problem.
Answers and highly appreciated,Thanks In Advance

2 件のコメント

Walter Roberson
Walter Roberson 2015 年 5 月 26 日
What is the data structure for the "field" ?
Ibraheem Salim
Ibraheem Salim 2015 年 5 月 27 日
Well Sir, struct is the data structure for field...

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

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 5 月 27 日

0 投票

x1 = Field1(1);
y1 = Field1(2);
x2 = Field2(1);
y2 = Field2(2);
But possibly your results are results from regionprops. If we assume that you had a call such as
Field = regionprops(YourImage, 'Centroid');
then
x1 = Field(1).Centroid(1);
y1 = Field(1).Centroid(2);
x2 = Field(2).Centroid(1);
y2 = Field(2).Centroid(2);

1 件のコメント

Ibraheem Salim
Ibraheem Salim 2015 年 5 月 27 日
Sir Walter, A bundle of thanks for your kind help. You don't know how your help make my life relaxed for time. Looking forward to more kind help and guidance from you Regards.

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

カテゴリ

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

質問済み:

2015 年 5 月 26 日

コメント済み:

2015 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by