comparing the minutes values of two tables

1 visualización (últimos 30 días)
Salma fathi
Salma fathi el 31 de Mzo. de 2022
Comentada: Arif Hoq el 31 de Mzo. de 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)

Respuestas (1)

Mahmoud Ashraf
Mahmoud Ashraf el 31 de Mzo. de 2022
try this
all(condition1)&&all(condition2)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by