comparing the minutes values of two tables

1 vue (au cours des 30 derniers jours)
Salma fathi
Salma fathi le 31 Mar 2022
Commenté : Arif Hoq le 31 Mar 2022
I am trying to make a comparison between the minutes value of the time from two tables using the following lines
first we checck if the dates are matching then we check if the value of the minutes in t2 satisfy the following:
minute of t2-30mins<=minute of t2<=minute of t2+30mins
[Lia2, Locb2] = ismember(t1.Date3, t2.date2);
indx2 = Locb2(Locb2 > 0);
% Tminu = '30:00';
% infmt = 'mm:ss';
% Dminu = duration(Tminu,'InputFormat',infmt);
t2.minadd30=minute(t2.date)+minutes(30);
t2.minsubtract30=minute(t2.date)-minutes(30);
t2mins=minute(t2.date);
if ( t2mins(indx2)>= t2.minsubtract30 && t2mins(indx2)<= t2.minadd30)
t1.foF2(Lia2)=t2.fof2(indx2);
if m==1
datatable=t1;
else
datatable=[datatable; t1];
end
end
but I am getting the following error
perands to the logical and (&&) and or (||) operators must be convertible to logical scalar values.
Error in Ionosonde_Data (line 112)
if ( t2mins(indx2)>= t2.minsubtract30 && t2mins(indx2)<= t2.minadd30)
  1 commentaire
Arif Hoq
Arif Hoq le 31 Mar 2022
It's better to attach your data and full code.

Connectez-vous pour commenter.

Réponses (1)

Mahmoud Ashraf
Mahmoud Ashraf le 31 Mar 2022
try this
all(condition1)&&all(condition2)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by