How to Filter Rows of Cell Array By Date Range
Simplied my problem so it’s easier to solve. I have a 4×3 array "a" and want to remove rows not within a specified date range. I would like to do this without a loop that would slow down my code. Any suggestions matlab wizards out there?
%Date Range
MinDate = datetime(’14-Jul-2024′);
MaxDate = datetime(’17-July-2024′);
%Cell Array
a = cell(4,3);
random = [1 1
2 1
3 3
4 5];
dates = datetime({’10-Jul-2024′
’15-Jul-2024′
’20-Jul-2024′
’16-Jul-2024′});
a(:,3) = num2cell(dates);
a(:,1:2) = num2cell(random);
%How do I filter a by deleting rows not within Date Range? i.e. delete rows 1 & 3 based on the value of aSimplied my problem so it’s easier to solve. I have a 4×3 array "a" and want to remove rows not within a specified date range. I would like to do this without a loop that would slow down my code. Any suggestions matlab wizards out there?
%Date Range
MinDate = datetime(’14-Jul-2024′);
MaxDate = datetime(’17-July-2024′);
%Cell Array
a = cell(4,3);
random = [1 1
2 1
3 3
4 5];
dates = datetime({’10-Jul-2024′
’15-Jul-2024′
’20-Jul-2024′
’16-Jul-2024′});
a(:,3) = num2cell(dates);
a(:,1:2) = num2cell(random);
%How do I filter a by deleting rows not within Date Range? i.e. delete rows 1 & 3 based on the value of a Simplied my problem so it’s easier to solve. I have a 4×3 array "a" and want to remove rows not within a specified date range. I would like to do this without a loop that would slow down my code. Any suggestions matlab wizards out there?
%Date Range
MinDate = datetime(’14-Jul-2024′);
MaxDate = datetime(’17-July-2024′);
%Cell Array
a = cell(4,3);
random = [1 1
2 1
3 3
4 5];
dates = datetime({’10-Jul-2024′
’15-Jul-2024′
’20-Jul-2024′
’16-Jul-2024′});
a(:,3) = num2cell(dates);
a(:,1:2) = num2cell(random);
%How do I filter a by deleting rows not within Date Range? i.e. delete rows 1 & 3 based on the value of a cell array, array, arrays, matrix, datetime, data, cell, cell arrays, struct, importing excel data, sort, filter, matlab, mathematics, matrix array, matrix manipulation, index, indexing, find, solve, function, functions, matlab function, embedded matlab function, speed, performance MATLAB Answers — New Questions