Filtering for variable amount of constraints
이전 댓글 표시
Hi Everyone,
I have the following problem: I want to filter a dataset for a number of constraints. However, this number of constraints is variable.
I have the follwing code:
%% Filter for cargo constraints
%Solution 1
Data.VCsuit = Data.VC(strcmp(Data.Cargotypes{3,1},Data.VC{:,6})==1 | strcmp(Data.Cargotypes{2,1},Data.VC{:,6})==1,:);
%Solution 2
for i = 1 : height(Data.Cargotypes)
Data.VCsuit = Data.VC(strcmp(Data.Cargotypes{i,1},Data.VC{:,6})==1,:);
end
the problem with solution 1 is the variable, the problem of solution 2 is that it overwrites the previous filter. All datasets are tables. How can I best approach this? The dataset is in the attachements.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!