How to remove indexed set of rows from a cell array
3 次查看(过去 30 天)
显示 更早的评论
i have a cell array "corb " = 10×5 cell array
1- first question :
i want to find the indexes of all elements in the first column , 100000< element <300000
i tried this it doesn't work : row_indices = find(cell2mat(corb(:,1))>100000 & corb(:,1))<300000)
2- Second question :
once i have the vector containing row indexes values lets say its V=[ 3;5;10]
I would like to create a new cell array that has all of the rows from the original cell array EXCEPT for the rows specified by V. ( remove those rows).
so how to proceed
0 个评论
回答(2 个)
the cyclist
2021-8-29
编辑:the cyclist
2021-8-29
% Identify rows
row_indices = find(cell2mat(corb(:,1))>100000 & cell2mat(corb(:,1))<300000);
% Define new array that is the same as corb, but and remove rows
corb2 = corb;
corb2(row_indices,:) = [];
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!