comparing the minutes values of two tables

1 Ansicht (letzte 30 Tage)
Salma fathi
Salma fathi am 31 Mär. 2022
Kommentiert: Arif Hoq am 31 Mär. 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)

Antworten (1)

Mahmoud Ashraf
Mahmoud Ashraf am 31 Mär. 2022
try this
all(condition1)&&all(condition2)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by