Info

This question is closed. Reopen it to edit or answer.

search within matrix for assign certain values

3 views (last 30 days)
Rana Sobhy
Rana Sobhy on 5 Nov 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
I have 2 matrices,Dim_label and Dimensionss Dimentionss is Bounding box result of image, saved at dim.mat file while Dim_label is box dimensions saved as (x,y , width, Height) i.e. saved at gt.mat file as i want to find the Dimensionss boxes that locate inside the Dim_label boxes. if located the Dimensionss will get label so i try the following code
load gt.mat
load dim.mat
b=find(Dim_label(:,5)==2);
location=Dim_label(b,:)
%for x=1:size(Dimentionss,1)
moree=find(Dimentionss(:,1)>=Dim_label(b,1)&... % x values
Dimentionss(:,2)>=Dim_label(b,2)&...
Dimentionss(:,3)<=Dim_label(b,3)&...
Dimentionss(:,4)<=Dim_label(b,4))
Dimentionss(moree,5)=2
Dimentionss
i try on Dim_label(:,5)==2 but the process will be repeated for the whole non zero rows in gt.mat file the error in Dimentionss matrix that the fifth column assigned with 2. How could i fix??

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!