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

2 次查看(过去 30 天)
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