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

1 vue (au cours des 30 derniers jours)
Rabia Sikandar
Rabia Sikandar le 23 Jan 2020
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 commentaires
Steven Lord
Steven Lord le 23 Jan 2020
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 le 23 Jan 2020
mser have candidate values and gBB have structure value how to compare these two?

Connectez-vous pour commenter.

Réponse acceptée

Steven Lord
Steven Lord le 23 Jan 2020
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

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by