Filtering Table by Date; Separate loops & functions does not work. Need to filter From date 1st then To date to create range of time for data table to output data in time rang

1 vue (au cours des 30 derniers jours)
% Value changed function: FROMDatePicker
function FROMDatePickerValueChanged(app, event)
app.Filter_FromDate = app.FROMDatePicker.Value;
numRows = size(app.UITable2.Data,1);
r = 1;
for i = 1:numRows
if app.UITable2.Data{i,3} >= app.Filter_FromDate
app.RowstoDel(r,1) = i;
r = r + 1;
elseif app.UITable2.Data{i,3} <= app.Filter_ToDate
end
end
app.UITable2.Data = app.UITable2.Data(app.RowstoDel,:);
%app.UITable2.Data(app.RowstoDel,:) = [];
end
% Value changed function: TODatePicker
function TODatePickerValueChanged(app, event)
app.Filter_ToDate = app.TODatePicker.Value;
numRows = size(app.UITable2.Data,1);
r = 1;
for i = 1:numRows
if app.UITable2.Data{i,3} <= app.Filter_ToDate
app.RowstoDel(r,1) = i;
r = r + 1;
%app.UITable2.Data(i,:) = [];
end
end
app.UITable2.Data = app.UITable2.Data(app.RowstoDel,:);
%app.UITable2.Data(app.RowstoDel,:) = [];

Réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by