Undefined operator '>' for input arguments of type 'struct'.

2 ビュー (過去 30 日間)
Rabia Sikandar
Rabia Sikandar 2020 年 1 月 23 日
回答済み: Steven Lord 2020 年 1 月 23 日
I have a label code when am running it give me a error "Undefined operator '>' for input arguments of type 'struct'. on this code.Can any one help me to resolve this issue?gBB have the groundtruth value and MSER have the candidate of actual image.
gBB=val;
LabBB=[];
for i=1:length(mserBB(:,1))
Label=0;
for j=1:length(gBB(:,1))
if mserBB(i,1)>gBB(j,1) && mserBB(i,2)> gBB(j,2) && mserBB(i,3)< gBB(j,3) && mserBB(i,4)< gBB(j,4)
Label=1;
end
end
  2 件のコメント
Steven Lord
Steven Lord 2020 年 1 月 23 日
What do the following lines of code display?
whos gBB mserBB
check_gBB = isstruct(gBB)
check_mserBB = isstruct(mserBB)
At least one of check_gBB and check_mserBB will be true.
Rabia Sikandar
Rabia Sikandar 2020 年 1 月 23 日
mser have candidate values and gBB have structure value how to compare these two?

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

採用された回答

Steven Lord
Steven Lord 2020 年 1 月 23 日
A struct array can be thought of like a filing cabinet. As an example, one of the drawers (fields) could be titled "taxDocuments", one is "insurance", still another is "utilityBills".
S = struct('taxDocuments', 1:10, 'insurance', magic(5), 'utilityBills', rand(3, 4, 6))
What would it mean to ask if 5 is greater than the filing cabinet? It could make more sense to ask if 5 was greater than part of the contents of one of the drawers in the filing cabinet:
if mserBB(1) > S.insurance(1) % if insurance is an array of numeric data

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by